| Package | Description |
|---|---|
| javax.annotation.processing |
Facilities for declaring annotation processors and for allowing annotation processors to communicate with an annotation processing tool environment.
|
| javax.lang.model.element |
Interfaces used to model elements of the Java programming language.
|
| javax.lang.model.type |
Interfaces used to model Java programming language types.
|
| javax.lang.model.util |
Utilities to assist in the processing of program elements and types.
|
| Modifier and Type | Method and Description |
|---|---|
Set |
RoundEnvironment.getElementsAnnotatedWith(Class
Returns the elements annotated with the given annotation type.
|
Set |
RoundEnvironment.getElementsAnnotatedWith(TypeElement
Returns the elements annotated with the given annotation type.
|
Set |
RoundEnvironment.getRootElements()
Returns the root elements for annotation processing generated by the prior round.
|
| Modifier and Type | Method and Description |
|---|---|
JavaFileObject |
Filer.createClassFile(CharSequence
Creates a new class file, and returns an object to allow writing to it.
|
FileObject |
Filer.createResource(JavaFileManager
Creates a new auxiliary resource file for writing and returns a file object for it.
|
JavaFileObject |
Filer.createSourceFile(CharSequence
Creates a new source file and returns an object to allow writing to it.
|
Iterable |
AbstractProcessor.getCompletions(Element
Returns an empty iterable of completions.
|
Iterable |
Processor.getCompletions(Element
Returns to the tool infrastructure an iterable of suggested completions to an annotation.
|
void |
Messager.printMessage(Diagnostic
Prints a message of the specified kind at the location of the element.
|
void |
Messager.printMessage(Diagnostic
Prints a message of the specified kind at the location of the annotation mirror of the annotated element.
|
void |
Messager.printMessage(Diagnostic
Prints a message of the specified kind at the location of the annotation value inside the annotation mirror of the annotated element.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
ExecutableElement
Represents a method, constructor, or initializer (static or instance) of a class or interface, including annotation type elements.
|
interface |
PackageElement
Represents a package program element.
|
interface |
Parameterizable
A mixin interface for an element that has type parameters.
|
interface |
QualifiedNameable
A mixin interface for an element that has a qualified name.
|
interface |
TypeElement
Represents a class or interface program element.
|
interface |
TypeParameterElement
Represents a formal type parameter of a generic class, interface, method, or constructor element.
|
interface |
VariableElement
Represents a field,
enum constant, method or constructor parameter, local variable, resource variable, or exception parameter.
|
| Modifier and Type | Method and Description |
|---|---|
Element |
VariableElement.getEnclosingElement()
Returns the enclosing element of this variable.
|
Element |
TypeElement.getEnclosingElement()
Returns the package of a top-level type and returns the immediately lexically enclosing element for a
nested type.
|
Element |
Element.getEnclosingElement()
Returns the innermost element within which this element is, loosely speaking, enclosed.
|
Element |
PackageElement.getEnclosingElement()
Returns
null since a package is not enclosed by another element.
|
Element |
TypeParameterElement.getEnclosingElement()
Returns the
generic element of this type parameter.
|
Element |
TypeParameterElement.getGenericElement()
Returns the generic class, interface, method, or constructor that is parameterized by this type parameter.
|
Element |
UnknownElementException.getUnknownElement()
Returns the unknown element.
|
| Modifier and Type | Method and Description |
|---|---|
List |
TypeElement.getEnclosedElements()
Returns the fields, methods, constructors, and member types that are directly declared in this class or interface.
|
List |
Element.getEnclosedElements()
Returns the elements that are, loosely speaking, directly enclosed by this element.
|
List |
PackageElement.getEnclosedElements()
Returns the
top-level classes and interfaces within this package.
|
| Modifier and Type | Method and Description |
|---|---|
R |
ElementVisitor.visit(Element
A convenience method equivalent to
v.visit(e, null).
|
R |
ElementVisitor.visit(Element
Visits an element.
|
R |
ElementVisitor.visitUnknown(Element
Visits an unknown kind of element.
|
| Constructor and Description | |
|---|---|
UnknownElementException(Element
Creates a new
UnknownElementException.
|
| Modifier and Type | Method and Description |
|---|---|
Element |
TypeVariable.asElement()
Returns the element corresponding to this type variable.
|
Element |
DeclaredType.asElement()
Returns the element corresponding to this type.
|
| Modifier and Type | Method and Description |
|---|---|
Element |
Types.asElement(TypeMirror
Returns the element corresponding to a type.
|
| Modifier and Type | Method and Description |
|---|---|
List |
Elements.getAllMembers(TypeElement
Returns all members of a type element, whether inherited or declared directly.
|
| Modifier and Type | Method and Description |
|---|---|
TypeMirror |
Types.asMemberOf(DeclaredType
Returns the type of an element when that element is viewed as a member of, or otherwise directly contained by, a given type.
|
protected R |
SimpleElementVisitor6.defaultAction(Element
The default action for visit methods.
|
List |
Elements.getAllAnnotationMirrors(Element
Returns all annotations
present on an element, whether directly present or present via inheritance.
|
String |
Elements.getDocComment(Element
Returns the text of the documentation ("Javadoc") comment of an element.
|
PackageElement |
Elements.getPackageOf(Element
Returns the package of an element.
|
boolean |
Elements.hides(Element
Tests whether one type, method, or field hides another.
|
boolean |
Elements.isDeprecated(Element
Returns
true if the element is deprecated,
false otherwise.
|
void |
Elements.printElements(Writer
Prints a representation of the elements to the given writer in the specified order.
|
R |
ElementScanner6.scan(Element
Convenience method equivalent to
v.scan(e, null).
|
R |
ElementScanner6.scan(Element
Processes an element by calling
e.accept(this, p); this method may be overridden by subclasses.
|
R |
AbstractElementVisitor6.visit(Element
Visits any program element as if by passing itself to that element's
accept method and passing
null for the additional parameter.
|
R |
AbstractElementVisitor6.visit(Element
Visits any program element as if by passing itself to that element's
accept method.
|
R |
AbstractElementVisitor6.visitUnknown(Element
Visits an unknown kind of element.
|
| Modifier and Type | Method and Description |
|---|---|
static List |
ElementFilter.constructorsIn(Iterable
Returns a list of constructors in
elements.
|
static Set |
ElementFilter.constructorsIn(Set
Returns a set of constructors in
elements.
|
static List |
ElementFilter.fieldsIn(Iterable
Returns a list of fields in
elements.
|
static Set |
ElementFilter.fieldsIn(Set
Returns a set of fields in
elements.
|
static List |
ElementFilter.methodsIn(Iterable
Returns a list of methods in
elements.
|
static Set |
ElementFilter.methodsIn(Set
Returns a set of methods in
elements.
|
static List |
ElementFilter.packagesIn(Iterable
Returns a list of packages in
elements.
|
static Set |
ElementFilter.packagesIn(Set
Returns a set of packages in
elements.
|
R |
ElementScanner6.scan(Iterable
Iterates over the given elements and calls
scan(Element, P) on each one.
|
static List |
ElementFilter.typesIn(Iterable
Returns a list of types in
elements.
|
static Set |
ElementFilter.typesIn(Set
Returns a set of types in
elements.
|