public class AnnotationFileElementTypes extends Object
Constructor and Description |
---|
AnnotationFileElementTypes(AnnotatedTypeFactory factory)
Creates an empty annotation source.
|
Modifier and Type | Method and Description |
---|---|
AnnotatedTypeMirror |
getAnnotatedTypeMirror(Element e)
Returns the annotated type for
e containing only annotations explicitly written in an
annotation file or null if e does not appear in an annotation file. |
Set<AnnotationMirror> |
getDeclAnnotation(Element elt)
Returns the set of declaration annotations for
e containing only annotations
explicitly written in an annotation file or the empty set if e does not appear in an
annotation file. |
@Nullable AnnotatedTypeMirror |
getFakeOverride(Element elt,
AnnotatedTypeMirror receiverType)
Returns the method type of the most specific fake override for the given element, when used
as a member of the given type.
|
boolean |
isParsing()
Returns true if files are currently being parsed; otherwise, false.
|
void |
parseStubFiles()
Parses the stub files in the following order:
jdk.astub in the same directory as the checker, if it exists and ignorejdkastub option
is not supplied
If parsing annotated JDK as stub files, all package-info.java files under the jdk/
directory
Stub files listed in @StubFiles annotation on the checker; must be in same directory as
the checker
Stub files provided via stubs system property
Stub files provided via stubs environment variable
Stub files provided via stubs compiler option
|
public AnnotationFileElementTypes(AnnotatedTypeFactory factory)
factory
- AnnotatedTypeFactorypublic boolean isParsing()
public void parseStubFiles()
If a type is annotated with a qualifier from the same hierarchy in more than one stub file, the qualifier in the last stub file is applied.
If using JDK 11, then the JDK stub files are only parsed if a type or declaration annotation is requested from a class in that file.
public AnnotatedTypeMirror getAnnotatedTypeMirror(Element e)
e
containing only annotations explicitly written in an
annotation file or null
if e
does not appear in an annotation file.e
- an Element whose type is returnede
containing only annotations explicitly written
in the annotation file and in the element. null
is returned if element
does not appear in an annotation file.public Set<AnnotationMirror> getDeclAnnotation(Element elt)
e
containing only annotations
explicitly written in an annotation file or the empty set if e
does not appear in an
annotation file.elt
- element for which annotations are returnede
containing only annotations explicitly written
in the annotation file and in the element. null
is returned if element
does not appear in an annotation file.public @Nullable AnnotatedTypeMirror getFakeOverride(Element elt, AnnotatedTypeMirror receiverType)
elt
- element for which annotations are returnedreceiverType
- the type of the class that contains member (or a subtype of it)elt
that is a fake override, or
null if there are no fake overrides