| Constructor | Description |
|---|---|
Trees() |
| Modifier and Type | Method | Description |
|---|---|---|
abstract String |
getDocComment(TreePath path) |
Returns the doc comment, if any, for the Tree node identified by a given TreePath.
|
abstract Element |
getElement(TreePath path) |
Returns the Element for the Tree node identified by a given TreePath.
|
abstract TypeMirror |
getLub(CatchTree tree) |
Returns the lub of an exception parameter declared in a catch clause.
|
abstract TypeMirror |
getOriginalType(ErrorType errorType) |
Returns the original type from the ErrorType object.
|
abstract TreePath |
getPath(CompilationUnitTree unit,
Tree node) |
Returns the path to tree node within the specified compilation unit.
|
abstract TreePath |
getPath(Element e) |
Returns the TreePath node for a given Element.
|
abstract TreePath |
getPath(Element e,
AnnotationMirror a) |
Returns the TreePath node for an AnnotationMirror on a given Element.
|
abstract TreePath |
getPath(Element e,
AnnotationMirror a,
AnnotationValue v) |
Returns the TreePath node for an AnnotationValue for an AnnotationMirror on a given Element.
|
abstract Scope |
getScope(TreePath path) |
Returns the Scope for the Tree node identified by a given TreePath.
|
abstract SourcePositions |
getSourcePositions() |
Returns a utility object for obtaining source positions.
|
abstract Tree |
getTree(Element element) |
Returns the Tree node for a given Element.
|
abstract Tree |
getTree(Element e,
AnnotationMirror a) |
Returns the Tree node for an AnnotationMirror on a given Element.
|
abstract Tree |
getTree(Element e,
AnnotationMirror a,
AnnotationValue v) |
Returns the Tree node for an AnnotationValue for an AnnotationMirror on a given Element.
|
abstract MethodTree |
getTree(ExecutableElement method) |
Returns the MethodTree node for a given ExecutableElement.
|
abstract ClassTree |
getTree(TypeElement element) |
Returns the ClassTree node for a given TypeElement.
|
abstract TypeMirror |
getTypeMirror(TreePath path) |
Returns the TypeMirror for the Tree node identified by a given TreePath.
|
static Trees |
instance(ProcessingEnvironment env) |
Returns a Trees object for a given ProcessingEnvironment.
|
static Trees |
instance(JavaCompiler.CompilationTask task) |
Returns 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.
|
abstract void |
printMessage(Diagnostic.Kind kind,
CharSequence msg,
Tree t,
CompilationUnitTree root) |
Prints a message of the specified kind at the location of the
tree within the provided compilation unit
|
public static Trees instance(JavaCompiler.CompilationTask task)
task - the compilation task for which to get the Trees objectIllegalArgumentException - if the task does not support the Trees API.public static Trees instance(ProcessingEnvironment env)
env - the processing environment for which to get the Trees objectIllegalArgumentException - if the env does not support the Trees API.public abstract SourcePositions getSourcePositions()
public abstract Tree getTree(Element element)
null if the node can not be found.element - the elementpublic abstract ClassTree getTree(TypeElement element)
null if the node can not be found.element - the elementpublic abstract MethodTree getTree(ExecutableElement method)
null if the node can not be found.method - the executable elementpublic abstract Tree getTree(Element e, AnnotationMirror a)
null if the node can not be found.e - the elementa - the annotation mirrorpublic abstract Tree getTree(Element e, AnnotationMirror a, AnnotationValue v)
null if the node can not be found.e - the elementa - the annotation mirrorv - the annotation valuepublic abstract TreePath getPath(CompilationUnitTree unit, Tree node)
unit - the compilation unitnode - the tree nodepublic abstract TreePath getPath(Element e)
null if the node can not be found.e - the elementpublic abstract TreePath getPath(Element e, AnnotationMirror a)
null if the node can not be found.e - the elementa - the annotation mirrorpublic abstract TreePath getPath(Element e, AnnotationMirror a, AnnotationValue v)
null if the node can not be found.e - the elementa - the annotation mirrorv - the annotation valuepublic abstract Element getElement(TreePath path)
null if the element is not available.path - the tree pathIllegalArgumentException - is the TreePath does not identify
a Tree node that might have an associated Element.public abstract TypeMirror getTypeMirror(TreePath path)
null if the TypeMirror is not available.path - the tree pathIllegalArgumentException - is the TreePath does not identify
a Tree node that might have an associated TypeMirror.public abstract Scope getScope(TreePath path)
null if the Scope is not available.path - the tree pathpublic abstract String getDocComment(TreePath path)
null if no doc comment was found.path - the tree pathDocTrees.getDocCommentTree(TreePath)public abstract boolean isAccessible(Scope scope, TypeElement type)
scope - the scope to be checkedtype - the type to be checkedtype 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 accessiblemember is accessible in typepublic abstract TypeMirror getOriginalType(ErrorType errorType)
errorType - The errorType for which we want to get the original type.public abstract void printMessage(Diagnostic.Kind kind, CharSequence msg, Tree t, CompilationUnitTree root)
kind - the kind of messagemsg - the message, or an empty string if nonet - the tree to use as a position hintroot - the compilation unit that contains treepublic abstract TypeMirror getLub(CatchTree tree)
tree - the tree for the catch clause Submit a bug or feature
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 2005, 2017, Oracle and/or its affiliates. 500 Oracle Parkway
Redwood Shores, CA 94065 USA. All rights reserved.
DRAFT 9-Debian+0-9b155-1