public class JavacElements extends Object implements Elements
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.
Elements.Origin
Modifier | Constructor and Description |
---|---|
protected |
JavacElements(Context context)
Public for use only by JavacProcessingEnvironment
|
Modifier and Type | Method and Description |
---|---|
List<Attribute.Compound> |
getAllAnnotationMirrors(Element e)
Returns all annotations of an element, whether
inherited or directly present.
|
FilteredMemberList |
getAllMembers(TypeElement element) |
Name |
getBinaryName(TypeElement type) |
String |
getConstantExpression(Object value) |
String |
getDocComment(Element e) |
Map<Symbol.MethodSymbol,Attribute> |
getElementValuesWithDefaults(AnnotationMirror a) |
Name |
getName(CharSequence cs) |
Symbol.PackageSymbol |
getPackageElement(CharSequence name) |
PackageElement |
getPackageOf(Element e) |
com.sun.tools.javac.model.JavacSourcePosition |
getSourcePosition(Element e) |
com.sun.tools.javac.model.JavacSourcePosition |
getSourcePosition(Element e,
AnnotationMirror a) |
com.sun.tools.javac.model.JavacSourcePosition |
getSourcePosition(Element e,
AnnotationMirror a,
AnnotationValue v) |
JCTree |
getTree(Element e)
Returns the tree node corresponding to this element, or null
if none can be found.
|
Pair<JCTree,JCTree.JCCompilationUnit> |
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.
|
Symbol.ClassSymbol |
getTypeElement(CharSequence name) |
boolean |
hides(Element hiderEl,
Element hideeEl) |
static JavacElements |
instance(Context context) |
boolean |
isDeprecated(Element e) |
boolean |
isFunctionalInterface(TypeElement element) |
boolean |
overrides(ExecutableElement riderEl,
ExecutableElement rideeEl,
TypeElement typeEl) |
void |
printElements(Writer w,
Element... elements)
Print a representation of the elements to the given writer in
the specified order.
|
void |
setContext(Context context)
Use a new context.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllModuleElements, getAllPackageElements, getAllTypeElements, getModuleElement, getModuleOf, getOrigin, getOrigin, getOrigin, getPackageElement, getTypeElement, isBridge
protected JavacElements(Context context)
public static JavacElements instance(Context context)
public void setContext(Context context)
public Symbol.PackageSymbol getPackageElement(CharSequence name)
getPackageElement
in interface Elements
public Symbol.ClassSymbol getTypeElement(CharSequence name)
getTypeElement
in interface Elements
public com.sun.tools.javac.model.JavacSourcePosition getSourcePosition(Element e)
public com.sun.tools.javac.model.JavacSourcePosition getSourcePosition(Element e, AnnotationMirror a)
public com.sun.tools.javac.model.JavacSourcePosition getSourcePosition(Element e, AnnotationMirror a, AnnotationValue v)
public JCTree getTree(Element e)
public String getDocComment(Element e)
getDocComment
in interface Elements
public PackageElement getPackageOf(Element e)
getPackageOf
in interface Elements
public boolean isDeprecated(Element e)
isDeprecated
in interface Elements
public Name getBinaryName(TypeElement type)
getBinaryName
in interface Elements
public Map<Symbol.MethodSymbol,Attribute> getElementValuesWithDefaults(AnnotationMirror a)
getElementValuesWithDefaults
in interface Elements
public FilteredMemberList getAllMembers(TypeElement element)
getAllMembers
in interface Elements
public List<Attribute.Compound> getAllAnnotationMirrors(Element e)
getAllAnnotationMirrors
in interface Elements
e
- the element being examinedpublic boolean overrides(ExecutableElement riderEl, ExecutableElement rideeEl, TypeElement typeEl)
public String getConstantExpression(Object value)
getConstantExpression
in interface Elements
public void printElements(Writer w, Element... elements)
printElements
in interface Elements
w
- the writer to print the output toelements
- the elements to printpublic Name getName(CharSequence cs)
public boolean isFunctionalInterface(TypeElement element)
isFunctionalInterface
in interface Elements
public Pair<JCTree,JCTree.JCCompilationUnit> getTreeAndTopLevel(Element e, AnnotationMirror a, AnnotationValue v)
Copyright © 2017 earcam. All rights reserved.