public class JavacTrees extends DocTrees
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.
Modifier and Type | Class and Description |
---|---|
protected static class |
JavacTrees.Copier
Makes a copy of a tree, noting the value resulting from copying a particular leaf.
|
Modifier | Constructor and Description |
---|---|
protected |
JavacTrees(Context context) |
Modifier and Type | Method and Description |
---|---|
protected JavacTrees.Copier |
createCopier(TreeMaker maker) |
String |
getDocComment(TreePath path)
Gets the doc comment, if any, for the Tree node identified by a given TreePath.
|
DocCommentTree |
getDocCommentTree(TreePath path)
Gets the doc comment tree, if any, for the Tree node identified by a given TreePath.
|
Element |
getElement(DocTreePath path)
Gets the language model element referred to by the leaf node of the given
DocTreePath , or null if unknown. |
Symbol |
getElement(TreePath path)
Gets the Element for the Tree node identified by a given TreePath.
|
TypeMirror |
getLub(CatchTree tree)
Gets the lub of an exception parameter declared in a catch clause.
|
TypeMirror |
getOriginalType(ErrorType errorType)
Gets the original type from the ErrorType object.
|
TreePath |
getPath(CompilationUnitTree unit,
Tree node)
Gets the path to tree node within the specified compilation unit.
|
TreePath |
getPath(Element e)
Gets the TreePath node for a given Element.
|
TreePath |
getPath(Element e,
AnnotationMirror a)
Gets the TreePath node for an AnnotationMirror on a given Element.
|
TreePath |
getPath(Element e,
AnnotationMirror a,
AnnotationValue v)
Gets the TreePath node for an AnnotationValue for an AnnotationMirror on a given Element.
|
JavacScope |
getScope(TreePath path)
Gets the Scope for the Tree node identified by a given TreePath.
|
DocSourcePositions |
getSourcePositions()
Gets a utility object for obtaining source positions.
|
JCTree |
getTree(Element element)
Gets the Tree node for a given Element.
|
JCTree |
getTree(Element e,
AnnotationMirror a)
Gets the Tree node for an AnnotationMirror on a given Element.
|
JCTree |
getTree(Element e,
AnnotationMirror a,
AnnotationValue v)
Gets the Tree node for an AnnotationValue for an AnnotationMirror on a given Element.
|
JCTree.JCMethodDecl |
getTree(ExecutableElement method)
Gets the MethodTree node for a given ExecutableElement.
|
JCTree.JCClassDecl |
getTree(TypeElement element)
Gets the ClassTree node for a given TypeElement.
|
TypeMirror |
getTypeMirror(TreePath path)
Gets the TypeMirror for the Tree node identified by a given TreePath.
|
static JavacTrees |
instance(Context context) |
static JavacTrees |
instance(JavaCompiler.CompilationTask task) |
static JavacTrees |
instance(ProcessingEnvironment env) |
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.
|
boolean |
isAccessible(Scope scope,
TypeElement type)
Checks whether a given type is accessible in a given scope.
|
void |
printMessage(Diagnostic.Kind kind,
CharSequence msg,
DocTree t,
DocCommentTree c,
CompilationUnitTree root)
Prints a message of the specified kind at the location of the
tree within the provided compilation unit
|
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
|
void |
updateContext(Context context) |
protected JavacTrees(Context context)
public static JavacTrees instance(JavaCompiler.CompilationTask task)
public static JavacTrees instance(ProcessingEnvironment env)
public static JavacTrees instance(Context context)
public void updateContext(Context context)
public DocSourcePositions getSourcePositions()
Trees
getSourcePositions
in class DocTrees
public JCTree.JCClassDecl getTree(TypeElement element)
Trees
public JCTree.JCMethodDecl getTree(ExecutableElement method)
Trees
public JCTree getTree(Element element)
Trees
public JCTree getTree(Element e, AnnotationMirror a)
Trees
public JCTree getTree(Element e, AnnotationMirror a, AnnotationValue v)
Trees
public TreePath getPath(CompilationUnitTree unit, Tree node)
Trees
public TreePath getPath(Element e)
Trees
public TreePath getPath(Element e, AnnotationMirror a)
Trees
public TreePath getPath(Element e, AnnotationMirror a, AnnotationValue v)
Trees
public Symbol getElement(TreePath path)
Trees
getElement
in class Trees
public Element getElement(DocTreePath path)
DocTrees
DocTreePath
, or null if unknown.getElement
in class DocTrees
public TypeMirror getTypeMirror(TreePath path)
Trees
getTypeMirror
in class Trees
public JavacScope getScope(TreePath path)
Trees
public String getDocComment(TreePath path)
Trees
getDocComment
in class Trees
DocTrees.getDocCommentTree(TreePath)
public DocCommentTree getDocCommentTree(TreePath path)
DocTrees
getDocCommentTree
in class DocTrees
public boolean isAccessible(Scope scope, TypeElement type)
Trees
isAccessible
in class Trees
scope
- the scope to be checkedtype
- the type to be checkedtype
is accessiblepublic boolean isAccessible(Scope scope, Element member, DeclaredType type)
Trees
isAccessible
in class Trees
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 type
protected JavacTrees.Copier createCopier(TreeMaker maker)
public TypeMirror getOriginalType(ErrorType errorType)
getOriginalType
in class Trees
errorType
- The errorType for which we want to get the original type.public void printMessage(Diagnostic.Kind kind, CharSequence msg, Tree t, CompilationUnitTree root)
printMessage
in class Trees
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 void printMessage(Diagnostic.Kind kind, CharSequence msg, DocTree t, DocCommentTree c, CompilationUnitTree root)
DocTrees
printMessage
in class DocTrees
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 TypeMirror getLub(CatchTree tree)
Trees
Copyright © 2017 earcam. All rights reserved.