| Constructor | 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 | 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, spliteratorpublic 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. 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