public class StubTypes extends Object
Constructor and Description |
---|
StubTypes(AnnotatedTypeFactory factory)
Creates a stub type.
|
Modifier and Type | Method and Description |
---|---|
AnnotatedTypeMirror |
getAnnotatedTypeMirror(Element e)
Returns the annotated type for
e containing only annotations explicitly written in a
stub file or null if e does not appear in a stub file. |
Set<AnnotationMirror> |
getDeclAnnotation(Element elt)
Returns the set of declaration annotations for
e containing only annotations
explicitly written in a stub file or the empty set if e does not appear in a stub
file. |
boolean |
isParsing()
Returns true if stub 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 a JDK as stub files, all package-info.java in the jdk directory Stub files listed in @StubFiles annotation on the checker; must be in same directory as the checker Stub files provide via stubs system property Stub files provide via stubs environment variable Stub files provide via stubs compiler option |
public StubTypes(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 a
stub file or null
if e
does not appear in a stub file.e
- an Element whose type is returnede
containing only annotations explicitly written
in the stubfile and in the element. null
is returned if element
does not
appear in a stub file.public Set<AnnotationMirror> getDeclAnnotation(Element elt)
e
containing only annotations
explicitly written in a stub file or the empty set if e
does not appear in a stub
file.elt
- element for which annotations are returnede
containing only annotations explicitly written
in the stubfile and in the element. null
is returned if element
does not
appear in a stub file.