Constructor and Description |
---|
TreePath(CompilationUnitTree node)
Creates a TreePath for a root node.
|
TreePath(TreePath path,
Tree tree)
Creates a TreePath for a child node.
|
Modifier and Type | Method and Description |
---|---|
CompilationUnitTree |
getCompilationUnit()
Returns the compilation unit associated with this path.
|
Tree |
getLeaf()
Returns the leaf node for this path.
|
TreePath |
getParentPath()
Returns the path for the enclosing node, or
null if there is no enclosing node. |
static TreePath |
getPath(CompilationUnitTree unit,
Tree target)
Returns a tree path for a tree node within a compilation unit,
or
null if the node is not found. |
static TreePath |
getPath(TreePath path,
Tree target)
Returns a tree path for a tree node within a subtree identified by a TreePath object.
|
Iterator<Tree> |
iterator()
Iterates from leaves to root.
|
forEach, spliterator
public TreePath(CompilationUnitTree node)
node
- the root nodepublic static TreePath getPath(CompilationUnitTree unit, Tree target)
null
if the node is not found.unit
- the compilation unit to searchtarget
- the node to locatepublic static TreePath getPath(TreePath path, Tree target)
null
if the node is not found.path
- the path in which to searchtarget
- the node to locatepublic CompilationUnitTree getCompilationUnit()
public Tree getLeaf()
public TreePath getParentPath()
null
if there is no enclosing node.
Copyright © 2005, 2016, Oracle and/or its affiliates. All rights reserved.
DRAFT 9-internal+0-2016-09-03-162606.buildd.src