|
Compiler Tree API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.source.util.Trees
public abstract class Trees
Bridges JSR 199, JSR 269, and the Tree API.
Constructor Summary | |
---|---|
Trees()
|
Method Summary | |
---|---|
abstract Element |
getElement(TreePath path)
Gets the Element for the Tree node identified by a given TreePath. |
abstract TreePath |
getPath(CompilationUnitTree unit,
Tree node)
Gets the path to tree node within the specified compilation unit. |
abstract TreePath |
getPath(Element e)
Gets the TreePath node for a given Element. |
abstract TreePath |
getPath(Element e,
AnnotationMirror a)
Gets the TreePath node for an AnnotationMirror on a given Element. |
abstract TreePath |
getPath(Element e,
AnnotationMirror a,
AnnotationValue v)
Gets the TreePath node for an AnnotationValue for an AnnotationMirror on a given Element. |
abstract Scope |
getScope(TreePath path)
Gets the Scope for the Tree node identified by a given TreePath. |
abstract SourcePositions |
getSourcePositions()
Gets a utility object for obtaining source positions. |
abstract Tree |
getTree(Element element)
Gets the Tree node for a given Element. |
abstract Tree |
getTree(Element e,
AnnotationMirror a)
Gets the Tree node for an AnnotationMirror on a given Element. |
abstract Tree |
getTree(Element e,
AnnotationMirror a,
AnnotationValue v)
Gets the Tree node for an AnnotationValue for an AnnotationMirror on a given Element. |
abstract MethodTree |
getTree(ExecutableElement method)
Gets the MethodTree node for a given ExecutableElement. |
abstract ClassTree |
getTree(TypeElement element)
Gets the ClassTree node for a given TypeElement. |
abstract TypeMirror |
getTypeMirror(TreePath path)
Gets the TypeMirror for the Tree node identified by a given TreePath. |
static Trees |
instance(JavaCompiler.CompilationTask task)
Gets a Trees object for a given CompilationTask. |
static Trees |
instance(ProcessingEnvironment env)
Gets a Trees object for a given CompilationTask. |
abstract boolean |
isAccessible(Scope scope,
Element member,
DeclaredType type)
Checks whether the given element is accessible as a member of the given type in a given scope. |
abstract boolean |
isAccessible(Scope scope,
TypeElement type)
Checks whether a given type is accessible in a given scope. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Trees()
Method Detail |
---|
public static Trees instance(JavaCompiler.CompilationTask task)
IllegalArgumentException
- if the task does not support the Trees API.public static Trees instance(ProcessingEnvironment env)
IllegalArgumentException
- if the env does not support the Trees API.public abstract SourcePositions getSourcePositions()
public abstract Tree getTree(Element element)
public abstract ClassTree getTree(TypeElement element)
public abstract MethodTree getTree(ExecutableElement method)
public abstract Tree getTree(Element e, AnnotationMirror a)
public abstract Tree getTree(Element e, AnnotationMirror a, AnnotationValue v)
public abstract TreePath getPath(CompilationUnitTree unit, Tree node)
public abstract TreePath getPath(Element e)
public abstract TreePath getPath(Element e, AnnotationMirror a)
public abstract TreePath getPath(Element e, AnnotationMirror a, AnnotationValue v)
public abstract Element getElement(TreePath path)
IllegalArgumentException
- is the TreePath does not identify
a Tree node that might have an associated Element.public abstract TypeMirror getTypeMirror(TreePath path)
IllegalArgumentException
- is the TreePath does not identify
a Tree node that might have an associated TypeMirror.public abstract Scope getScope(TreePath path)
public abstract boolean isAccessible(Scope scope, TypeElement type)
scope
- the scope to be checkedtype
- the type to be checked
type
is accessiblepublic abstract boolean isAccessible(Scope scope, Element member, DeclaredType type)
scope
- the scope to be checkedmember
- the member to be checkedtype
- the type for which to check if the member is accessible
member
is accessible in type
|
Compiler Tree API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |