org.eclipse.jdt.internal.compiler.apt.model
Class ElementsImpl

java.lang.Object
  extended by 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.


Constructor Summary
ElementsImpl(BaseProcessingEnvImpl env)
           
 
Method Summary
 List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e)
          Return all the annotation mirrors on this element, including inherited annotations.
 List<? extends Element> getAllMembers(TypeElement type)
          Compute a list of all the visible entities in this type.
 Name getBinaryName(TypeElement type)
           
 String getConstantExpression(Object value)
           
 String getDocComment(Element e)
           
 Map<? extends ExecutableElement,? extends AnnotationValue> getElementValuesWithDefaults(AnnotationMirror a)
           
 Name getName(CharSequence cs)
           
 PackageElement getPackageElement(CharSequence name)
           
 PackageElement getPackageOf(Element type)
           
 TypeElement getTypeElement(CharSequence name)
           
 boolean hides(Element hider, Element hidden)
           
 boolean isDeprecated(Element e)
           
 boolean overrides(ExecutableElement overrider, ExecutableElement overridden, TypeElement type)
           
 void printElements(Writer w, Element... elements)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementsImpl

public ElementsImpl(BaseProcessingEnvImpl env)
Method Detail

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:

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.