| javax.lang.model.util.Elements
All known Subclasses: com.sun.tools.javac.model.JavacElements,
Elements | public interface Elements (Code) | | Utility methods for operating on program elements.
Compatibility Note: Methods may be added to this interface
in future releases of the platform.
author: Joseph D. Darcy author: Scott Seligman author: Peter von der Ahé version: 1.17 07/05/05 See Also: javax.annotation.processing.ProcessingEnvironment.getElementUtils since: 1.6 |
Method Summary | |
List<? extends AnnotationMirror> | getAllAnnotationMirrors(Element e) Returns all annotations of an element, whether
inherited or directly present. | List<? extends Element> | getAllMembers(TypeElement type) Returns all members of a type element, whether inherited or
declared directly. | Name | getBinaryName(TypeElement type) Returns the binary name of a type element. | String | getConstantExpression(Object value) Returns the text of a constant expression representing a
primitive value or a string. | String | getDocComment(Element e) Returns the text of the documentation ("Javadoc")
comment of an element. | Map<? extends ExecutableElement, ? extends AnnotationValue> | getElementValuesWithDefaults(AnnotationMirror a) Returns the values of an annotation's elements, including defaults. | Name | getName(CharSequence cs) Return a name with the same sequence of characters as the
argument. | PackageElement | getPackageElement(CharSequence name) Returns a package given its fully qualified name. | PackageElement | getPackageOf(Element type) Returns the package of an element. | TypeElement | getTypeElement(CharSequence name) Returns a type element given its canonical name. | boolean | hides(Element hider, Element hidden) Tests whether one type, method, or field hides another. | boolean | isDeprecated(Element e) Returns
true if the element is deprecated,
false otherwise. | boolean | overrides(ExecutableElement overrider, ExecutableElement overridden, TypeElement type) | void | printElements(java.io.Writer w, Element... elements) Prints a representation of the elements to the given writer in
the specified order. |
getAllMembers | List<? extends Element> getAllMembers(TypeElement type)(Code) | | 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.
Note that elements of certain kinds can be isolated using
methods in
ElementFilter .
Parameters: type - the type being examined all members of the type See Also: Element.getEnclosedElements |
getConstantExpression | String getConstantExpression(Object value)(Code) | | 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.
Parameters: value - a primitive value or string the text of a constant expression throws: IllegalArgumentException - if the argument is not a primitivevalue or string See Also: VariableElement.getConstantValue |
getDocComment | String getDocComment(Element e)(Code) | | Returns the text of the documentation ("Javadoc")
comment of an element.
Parameters: e - the element being examined the documentation comment of the element, or null if there is none |
getName | Name getName(CharSequence cs)(Code) | | Return a name with the same sequence of characters as the
argument.
Parameters: cs - the character sequence to return as a name |
getPackageElement | PackageElement getPackageElement(CharSequence name)(Code) | | Returns a package given its fully qualified name.
Parameters: name - fully qualified package name, or "" for an unnamed package the named package, or null if it cannot be found |
getPackageOf | PackageElement getPackageOf(Element type)(Code) | | Returns the package of an element. The package of a package is
itself.
Parameters: type - the element being examined the package of an element |
getTypeElement | TypeElement getTypeElement(CharSequence name)(Code) | | Returns a type element given its canonical name.
Parameters: name - the canonical name the named type element, or null if it cannot be found |
hides | boolean hides(Element hider, Element hidden)(Code) | | Tests whether one type, method, or field hides another.
Parameters: hider - the first element Parameters: hidden - the second element true if and only if the first element hidesthe second |
isDeprecated | boolean isDeprecated(Element e)(Code) | | Returns
true if the element is deprecated,
false otherwise.
Parameters: e - the element being examined true if the element is deprecated, false otherwise |
printElements | void printElements(java.io.Writer w, Element... elements)(Code) | | Prints 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.
Parameters: w - the writer to print the output to Parameters: elements - the elements to print |
|
|