org.eclipse.jdt.internal.compiler.apt.model
Class ElementsImpl
java.lang.Object
org.eclipse.jdt.internal.compiler.apt.model.ElementsImpl
- All Implemented Interfaces:
- Elements
public class ElementsImpl
- extends Object
- implements Elements
Utilities for working with language elements.
There is one of these for every ProcessingEnvironment.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ElementsImpl
public ElementsImpl(BaseProcessingEnvImpl env)
getAllAnnotationMirrors
public List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e)
- Return all the annotation mirrors on this element, including inherited annotations.
Annotations are inherited only if the annotation type is meta-annotated with @Inherited,
and the annotation is on a class: e.g., annotations are not inherited for interfaces, methods,
or fields.
- Specified by:
getAllAnnotationMirrors
in interface Elements
getAllMembers
public List<? extends Element> getAllMembers(TypeElement type)
- Compute a list of all the visible entities in this type. Specifically:
- All nested types declared in this type, including interfaces and enums
- All protected or public nested types declared in this type's superclasses
and superinterfaces, that are not hidden by a name collision
- All methods declared in this type, including constructors but not
including static or instance initializers, and including abstract
methods and unimplemented methods declared in interfaces
- All protected or public methods declared in this type's superclasses,
that are not overridden by another method, but not including constructors
or initializers. Includes abstract methods and methods declared in
superinterfaces but not implemented
- All fields declared in this type, including constants
- All non-private fields declared in this type's superclasses and
superinterfaces, that are not hidden by a name collision.
- Specified by:
getAllMembers
in interface Elements
getBinaryName
public Name getBinaryName(TypeElement type)
- Specified by:
getBinaryName
in interface Elements
getConstantExpression
public String getConstantExpression(Object value)
- Specified by:
getConstantExpression
in interface Elements
getDocComment
public String getDocComment(Element e)
- Specified by:
getDocComment
in interface Elements
getElementValuesWithDefaults
public Map<? extends ExecutableElement,? extends AnnotationValue> getElementValuesWithDefaults(AnnotationMirror a)
- Specified by:
getElementValuesWithDefaults
in interface Elements
- Returns:
- all the annotation instance's explicitly set values, plus default values
for all the annotation members that are not explicitly set but that have
defaults. By comparison,
AnnotationMirror.getElementValues()
only
returns the explicitly set values. - See Also:
Elements.getElementValuesWithDefaults(javax.lang.model.element.AnnotationMirror)
getName
public Name getName(CharSequence cs)
- Specified by:
getName
in interface Elements
getPackageElement
public PackageElement getPackageElement(CharSequence name)
- Specified by:
getPackageElement
in interface Elements
getPackageOf
public PackageElement getPackageOf(Element type)
- Specified by:
getPackageOf
in interface Elements
getTypeElement
public TypeElement getTypeElement(CharSequence name)
- Specified by:
getTypeElement
in interface Elements
hides
public boolean hides(Element hider,
Element hidden)
- Specified by:
hides
in interface Elements
isDeprecated
public boolean isDeprecated(Element e)
- Specified by:
isDeprecated
in interface Elements
overrides
public boolean overrides(ExecutableElement overrider,
ExecutableElement overridden,
TypeElement type)
- Specified by:
overrides
in interface Elements
printElements
public void printElements(Writer w,
Element... elements)
- Specified by:
printElements
in interface Elements
Copyright © 2012. All Rights Reserved.