This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| private final Set | |
| private final Attr | |
| private final Enter | |
| private final JavaCompiler | |
| private final JavacTaskImpl | |
| private final Log | |
| private final Modules | |
| private final Names | |
| private final Resolve | |
| private final Map | |
| private final Symtab | |
| private final Types |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private static <T> T | |
| private static boolean | containsAnnoOfType(List<Attribute.
Tests whether a list of annotations contains an annotation of a given type. |
| private <S extends Symbol> S | |
| private Symbol. | |
| private Symbol. | |
| private void | |
| public List | Returns: all annotations of the elementthe element being examined e)Implements javax. Returns all annotations of an element, whether inherited or directly present. |
| public FilteredMemberList | getAllMembers(TypeElement element)
Implements javax. Returns all members of a type element, whether inherited or declared directly. |
| public Set | getAllModuleElements()
Overrides default javax. Returns all module elements in the current environment. |
| public Name | getBinaryName(TypeElement type)
Implements javax. Returns the binary name of a type element. |
| public String | getConstantExpression(Object value)
Implements javax. Returns the text of a constant expression representing a primitive value or a string. |
| public String | getDocComment(Element e)
Implements javax. Returns the text of the documentation ("JavaDoc") comment of an element. |
| private <R> R | |
| public Elements. | getDocCommentKind(Element e)
Overrides default javax. Returns the kind of the documentation comment for the given element,
or |
| public Map | getElementValuesWithDefaults(AnnotationMirror a)
Implements javax. Returns the values of an annotation's elements, including defaults. |
| private Env | |
| public TypeElement | getEnumConstantBody(VariableElement enumConstant)
Overrides default javax. Returns the class body of an |
| public JavaFileObject | getFileObjectOf(Element e)
Overrides default javax. Returns the file object for this element or |
| public Symbol. | getModuleElement(CharSequence name)
Overrides default javax. Returns a module element given its fully qualified name. |
| public ModuleElement | getModuleOf(Element e)
Overrides default javax. Returns the module of an element. |
| public Name | getName(CharSequence cs)
Implements javax. Returns a name with the same sequence of characters as the argument. |
| public Elements. | getOrigin(Element e)
Overrides default javax. Returns the origin of the given element. |
| public Elements. | getOrigin(AnnotatedConstruct c, AnnotationMirror a)
Overrides default javax. Returns the origin of the given annotation mirror. |
| public Elements. | getOrigin(ModuleElement m, ModuleElement.
Overrides default javax. Returns the origin of the given module directive. |
| public TypeElement | getOutermostTypeElement(Element e)
Overrides default javax. Returns the outermost type element an element is contained in
if such a containing element exists; otherwise returns |
| public Symbol. | getPackageElement(CharSequence name)
Implements javax. Returns a package given its fully qualified name if the package is uniquely determinable in the environment. |
| public Symbol. | getPackageElement(ModuleElement module, CharSequence name)
Overrides default javax. Returns a package given its fully qualified name, as seen from the given module. |
| public PackageElement | getPackageOf(Element e)
Implements javax. Returns the package of an element. |
| public JCTree | |
| private JCTree | |
| private Pair | getTreeAndTopLevel(Element e)
Returns the tree node and compilation unit corresponding to this element, or null if they can't be found. |
| public Pair | getTreeAndTopLevel(Element e, AnnotationMirror a, AnnotationValue v)
Returns the best approximation for the tree node and compilation unit corresponding to the given element, annotation and value. |
| public Symbol. | getTypeElement(CharSequence name)
Implements javax. Returns a type element given its canonical name if the type element is uniquely determinable in the environment. |
| public Symbol. | getTypeElement(ModuleElement module, CharSequence name)
Overrides default javax. Returns a type element given its canonical name, as seen from the given module. |
| public boolean | hides(Element hiderEl, Element hideeEl)
Implements javax. Tests whether one type, method, or field hides another. |
| public static JavacElements | |
| public boolean | isAutomaticModule(ModuleElement module)
Overrides default javax. Returns |
| public boolean | isCanonicalConstructor(ExecutableElement e)
Overrides default javax. Returns |
| public boolean | isCompactConstructor(ExecutableElement e)
Overrides default javax. Returns |
| public boolean | isDeprecated(Element e)
Implements javax. Returns |
| public boolean | isFunctionalInterface(TypeElement element)
Implements javax. Returns |
| private boolean | |
| private JCTree | matchAnnoToTree(AnnotationMirror findme, Element e, JCTree tree)
Returns the tree for an annotation given the annotated element and the element's own tree. |
| private JCTree | matchAnnoToTree(Attribute.
Returns the tree for an annotation given a list of annotations in which to search (recursively) and their corresponding trees. |
| private JCTree | matchAttributeToTree(final Attribute findme, final Attribute attr, final JCTree tree)
Returns the tree for an attribute given an enclosing attribute to search (recursively) and the enclosing attribute's corresponding tree. |
| private <S extends Symbol> S | nameToSymbol(Symbol.
Returns a symbol given the type's or package's canonical name, or null if the name isn't found. |
| public void | |
| public boolean | overrides(ExecutableElement riderEl, ExecutableElement rideeEl, TypeElement typeEl)
Implements javax. Tests whether one method, as a member of a given class or interface, overrides another method. |
| public void | printElements(Writer
the writer to print the output to w, Element... the elements to print elements)Implements javax. Print a representation of the elements to the given writer in the specified order. |
| private JCTree. | scanForAssign(final Symbol.
Scans for a JCAssign node with a LHS matching a given symbol, and returns its RHS. |
| private <S extends Symbol> S |
| allowModules | back to summary |
|---|---|
| private final boolean allowModules | |
| alreadyWarnedDuplicates | back to summary |
|---|---|
| private final Set<String> alreadyWarnedDuplicates | |
| attr | back to summary |
|---|---|
| private final Attr attr | |
| enter | back to summary |
|---|---|
| private final Enter enter | |
| javaCompiler | back to summary |
|---|---|
| private final JavaCompiler javaCompiler | |
| javacTaskImpl | back to summary |
|---|---|
| private final JavacTaskImpl javacTaskImpl | |
| log | back to summary |
|---|---|
| private final Log log | |
| modules | back to summary |
|---|---|
| private final Modules modules | |
| names | back to summary |
|---|---|
| private final Names names | |
| resolve | back to summary |
|---|---|
| private final Resolve resolve | |
| resultCache | back to summary |
|---|---|
| private final Map<Pair<String, String>, Optional<Symbol>> resultCache | |
| syms | back to summary |
|---|---|
| private final Symtab syms | |
| types | back to summary |
|---|---|
| private final Types types | |
| JavacElements | back to summary |
|---|---|
protected JavacElements(Context context)
| |
| addMembers | back to summary |
|---|---|
| private void addMembers(Scope. | |
| cast | back to summary |
|---|---|
| private static <T> T cast(Class<T> clazz, Object o) Returns an object cast to the specified type.
| |
| containsAnnoOfType | back to summary |
|---|---|
| private static boolean containsAnnoOfType(List<Attribute. Tests whether a list of annotations contains an annotation of a given type. | |
| doGetElement | back to summary |
|---|---|
| private <S extends Symbol> S doGetElement(ModuleElement module, String methodName, CharSequence name, Class<S> clazz) | |
| doGetPackageElement | back to summary |
|---|---|
| private Symbol. | |
| doGetTypeElement | back to summary |
|---|---|
| private Symbol. | |
| ensureEntered | back to summary |
|---|---|
| private void ensureEntered(String methodName) | |
| getAllAnnotationMirrors | back to summary |
|---|---|
| public List Implements javax. Returns all annotations of an element, whether inherited or directly present. | |
| getAllMembers | back to summary |
|---|---|
| public FilteredMemberList getAllMembers(TypeElement element) Implements javax. Doc from javax. Returns all members of a type element, whether inherited or declared directly. For a class, the result also includes its constructors, but not local or anonymous classes.
| |
| getAllModuleElements | back to summary |
|---|---|
| public Set Overrides default javax. Doc from javax. Returns all module elements in the current environment. If no modules are present, an empty set is returned. One situation where no modules are present occurs when the environment does not include modules, such as an annotation processing environment configured for a source version without modules.
| |
| getBinaryName | back to summary |
|---|---|
| public Name getBinaryName(TypeElement type) Implements javax. Doc from javax. Returns the binary name of a type element.
| |
| getConstantExpression | back to summary |
|---|---|
| public String getConstantExpression(Object value) Implements javax. Doc from javax. Returns the text of a constant expression representing a primitive value or a string. The text returned is in a form suitable for representing the value in source code.
| |
| getDocComment | back to summary |
|---|---|
| public String getDocComment(Element e) Implements javax. Doc from javax. Returns the text of the documentation ("JavaDoc") comment of an element. A documentation comment of an element is a particular kind of comment that immediately precedes the element, ignoring white space, annotations and any other comments that are not themselves documentation comments. There are two kinds of documentation comments, either based on traditional comments or based on a series of end-of-line comments. For both kinds, the text returned for the documentation comment is a processed form of the comment as it appears in source code, as described below. A traditional
documentation comment is a traditional comment that begins
with "
An end-of-line
documentation comment is a series of adjacent end-of-line
comments, each on a line by itself, ignoring any whitespace
characters at the beginning of the line, and each beginning
with "
| |
| getDocCommentItem | back to summary |
|---|---|
| private <R> R getDocCommentItem(Element e, BiFunction<DocCommentTable, JCTree, R> f) | |
| getDocCommentKind | back to summary |
|---|---|
| public Elements. Overrides default javax. Doc from javax. Returns the kind of the documentation comment for the given element,
or
| |
| getElementValuesWithDefaults | back to summary |
|---|---|
| public Map Implements javax. Doc from javax. Returns the values of an annotation's elements, including defaults.
| |
| getEnterEnv | back to summary |
|---|---|
| private Env Returns a symbol's enter environment, or null if it has none. | |
| getEnumConstantBody | back to summary |
|---|---|
| public TypeElement getEnumConstantBody(VariableElement enumConstant) Overrides default javax. Doc from javax. Returns the class body of an
| |
| getFileObjectOf | back to summary |
|---|---|
| public JavaFileObject getFileObjectOf(Element e) Overrides default javax. Doc from javax. Returns the file object for this element or The returned file object is for the reference
representation of the information used to construct the
element. For example, if during compilation or annotation
processing, a source file for class An implementation may choose to not support the
functionality of this method, in which case In the context of annotation processing, a non- If it has a file object, the file object for a package will
be a If it has a file object, the file object for a module will
be a If it has a file object, the file object for a top-level
For a nested class or interface, if it has a file object:
For other lexically enclosed elements, such as variables, methods, and constructors, if they have a file object, the file object will be the object associated with the enclosing element of the lexically enclosed element.
| |
| getModuleElement | back to summary |
|---|---|
| public Symbol. Overrides default javax. Doc from javax. Returns a module element given its fully qualified name.
If the requested module cannot be found,
| |
| getModuleOf | back to summary |
|---|---|
| public ModuleElement getModuleOf(Element e) Overrides default javax. Doc from javax. Returns the module of an element. The module of a module is
itself.
If a package has a module as its enclosing element, that
module is the module of the package. If the enclosing element
of a package is
| |
| getName | back to summary |
|---|---|
| public Name getName(CharSequence cs) Implements javax. Doc from javax. Returns a name with the same sequence of characters as the argument.
| |
| getOrigin | back to summary |
|---|---|
| public Elements. Overrides default javax. Doc from javax. Returns the origin of the given element. Note that if this method returns
| |
| getOrigin | back to summary |
|---|---|
| public Elements. Overrides default javax. Doc from javax. Returns the origin of the given annotation mirror. An annotation mirror is mandated if it is an implicitly declared container annotation used to hold repeated annotations of a repeatable annotation interface. Note that if this method returns
| |
| getOrigin | back to summary |
|---|---|
| public Elements. Overrides default javax. Doc from javax. Returns the origin of the given module directive. Note that if this method returns Note that an implementation may not be able to reliably determine the origin status of the directive if the directive is created from a class file due to limitations of the fidelity of the class file format in preserving information from source code.
| |
| getOutermostTypeElement | back to summary |
|---|---|
| public TypeElement getOutermostTypeElement(Element e) Overrides default javax. Doc from javax. Returns the outermost type element an element is contained in
if such a containing element exists; otherwise returns
| |
| getPackageElement | back to summary |
|---|---|
| public Symbol. Implements javax. Doc from javax. Returns a package given its fully qualified name if the package is uniquely determinable in the environment. If running with modules, packages of the given name are searched in a two-stage process:
null is returned.
| |
| getPackageElement | back to summary |
|---|---|
| public Symbol. Overrides default javax. Doc from javax. Returns a package given its fully qualified name, as seen from the given module.
| |
| getPackageOf | back to summary |
|---|---|
| public PackageElement getPackageOf(Element e) Implements javax. Doc from javax. Returns the package of an element. The package of a package is
itself.
The package of a module is
| |
| getTree | back to summary |
|---|---|
| public JCTree getTree(Element e) Returns the tree node corresponding to this element, or null if none can be found. | |
| getTreeAlt | back to summary |
|---|---|
| private JCTree getTreeAlt(Element e) | |
| getTreeAndTopLevel | back to summary |
|---|---|
| private Pair Returns the tree node and compilation unit corresponding to this element, or null if they can't be found. | |
| getTreeAndTopLevel | back to summary |
|---|---|
| public Pair Returns the best approximation for the tree node and compilation unit corresponding to the given element, annotation and value. If the element is null, null is returned. If the annotation is null or cannot be found, the tree node and compilation unit for the element is returned. If the annotation value is null or cannot be found, the tree node and compilation unit for the annotation is returned. | |
| getTypeElement | back to summary |
|---|---|
| public Symbol. Implements javax. Doc from javax. Returns a type element given its canonical name if the type element is uniquely determinable in the environment. If running with modules, type elements of the given name are searched in a two-stage process:
null is returned.
| |
| getTypeElement | back to summary |
|---|---|
| public Symbol. Overrides default javax. Doc from javax. Returns a type element given its canonical name, as seen from the given module.
| |
| hides | back to summary |
|---|---|
| public boolean hides(Element hiderEl, Element hideeEl) Implements javax. Doc from javax. Tests whether one type, method, or field hides another.
| |
| instance | back to summary |
|---|---|
| public static JavacElements instance(Context context) | |
| isAutomaticModule | back to summary |
|---|---|
| public boolean isAutomaticModule(ModuleElement module) Overrides default javax. Doc from javax. Returns
| |
| isCanonicalConstructor | back to summary |
|---|---|
| public boolean isCanonicalConstructor(ExecutableElement e) Overrides default javax. Doc from javax. Returns
| |
| isCompactConstructor | back to summary |
|---|---|
| public boolean isCompactConstructor(ExecutableElement e) Overrides default javax. Doc from javax. Returns
| |
| isDeprecated | back to summary |
|---|---|
| public boolean isDeprecated(Element e) Implements javax. Doc from javax. Returns
| |
| isFunctionalInterface | back to summary |
|---|---|
| public boolean isFunctionalInterface(TypeElement element) Implements javax. Doc from javax. Returns
| |
| isInherited | back to summary |
|---|---|
| private boolean isInherited(Type annotype) Tests whether an annotation type is @Inherited. | |
| matchAnnoToTree | back to summary |
|---|---|
| private JCTree matchAnnoToTree(AnnotationMirror findme, Element e, JCTree tree) Returns the tree for an annotation given the annotated element and the element's own tree. Returns null if the tree cannot be found. | |
| matchAnnoToTree | back to summary |
|---|---|
| private JCTree matchAnnoToTree(Attribute. Returns the tree for an annotation given a list of annotations in which to search (recursively) and their corresponding trees. Returns null if the tree cannot be found. | |
| matchAttributeToTree | back to summary |
|---|---|
| private JCTree matchAttributeToTree(final Attribute findme, final Attribute attr, final JCTree tree) Returns the tree for an attribute given an enclosing attribute to search (recursively) and the enclosing attribute's corresponding tree. Returns null if the tree cannot be found. | |
| nameToSymbol | back to summary |
|---|---|
| private <S extends Symbol> S nameToSymbol(Symbol. Returns a symbol given the type's or package's canonical name, or null if the name isn't found. | |
| newRound | back to summary |
|---|---|
| public void newRound() | |
| overrides | back to summary |
|---|---|
| public boolean overrides(ExecutableElement riderEl, ExecutableElement rideeEl, TypeElement typeEl) Implements javax. Doc from javax. Tests whether one method, as a member of a given class or interface, overrides another method. When a non-abstract method overrides an abstract one, the former is also said to implement the latter. As implied by JLS 8.4.8.1, a method does not override itself. The overrides relation is irreflexive. In the simplest and most typical usage, the value of the
A more interesting case can be illustrated by the following example
in which a method in class A does not override a
like-named method in interface B:
When viewed as a member of a third class C, however,
the method in A does override the one in B:
Consistent with the usage of the @Override
annotation, if an interface declares a method
override-equivalent to a public method of java., such a method of the interface is regarded
as overriding the corresponding Object method; for
example:
interface I { @Override String toString(); } ... assert elements.overrides(elementForItoString, elementForObjecttoString, elements.getTypeElement("I"));
| |
| printElements | back to summary |
|---|---|
| public void printElements(Writer w, Element... elements) Implements javax. Print a representation of the elements to the given writer in the specified order. The main purpose of this method is for diagnostics. The exact format of the output is not specified and is subject to change.
| |
| scanForAssign | back to summary |
|---|---|
| private JCTree. Scans for a JCAssign node with a LHS matching a given symbol, and returns its RHS. Does not scan nested JCAnnotations. | |
| unboundNameToSymbol | back to summary |
|---|---|
private <S extends Symbol> S unboundNameToSymbol(String methodName, String nameStr, Class<S> clazz)
| |