Class AnnotationFileParser.RecordComponentStub
- java.lang.Object
-
- org.checkerframework.framework.stub.AnnotationFileParser.RecordComponentStub
-
- Enclosing class:
- AnnotationFileParser
public static class AnnotationFileParser.RecordComponentStub extends java.lang.Object
Information about a record component: its type, and whether there was an accessor in the stubs for that component. That is, for a component "foo" was there a method named exactly "foo()" in the stubs. If so, annotations on that accessor will take precedence over annotations that would otherwise be copied from the component in the stubs to the acessor.
-
-
Field Summary
Fields Modifier and Type Field Description AnnotatedTypeMirror
type
The type of the record component.
-
Constructor Summary
Constructors Constructor Description RecordComponentStub(AnnotatedTypeMirror type, AnnotationMirrorSet allAnnotations)
Creates a new RecordComponentStub with the given type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotationMirrorSet
getAnnotationsForTarget(javax.lang.model.element.ElementKind elementKind)
Get the record component annotations that are applicable to the given element kind.boolean
hasAccessorInStubs()
Returns whether there is an accessor in a stub file.
-
-
-
Field Detail
-
type
public final AnnotatedTypeMirror type
The type of the record component.
-
-
Constructor Detail
-
RecordComponentStub
public RecordComponentStub(AnnotatedTypeMirror type, AnnotationMirrorSet allAnnotations)
Creates a new RecordComponentStub with the given type.- Parameters:
type
- the type of the record componentallAnnotations
- the declaration annotations on the component
-
-
Method Detail
-
getAnnotationsForTarget
public AnnotationMirrorSet getAnnotationsForTarget(javax.lang.model.element.ElementKind elementKind)
Get the record component annotations that are applicable to the given element kind.- Parameters:
elementKind
- the element kind to apply to (e.g., FIELD, METHOD)- Returns:
- the set of annotations from the component that apply
-
hasAccessorInStubs
public boolean hasAccessorInStubs()
Returns whether there is an accessor in a stub file.- Returns:
- true if some stub file contains an accessor for this record component
-
-