- java.lang.Object
-
- com.sun.source.util.TreePath
-
-
构造方法摘要
构造方法 Constructor 描述 TreePath(CompilationUnitTree node)为根节点创建一个TreePath。TreePath(TreePath path, 树 tree)为子节点创建一个TreePath。
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 CompilationUnitTreegetCompilationUnit()返回与此路径关联的编译单元。树getLeaf()返回此路径的叶节点。TreePathgetParentPath()返回包围节点的路径,如果没有包围节点,则返回null。static TreePathgetPath(CompilationUnitTree unit, 树 target)返回编译单元中树节点的树路径,如果未找到该节点,则null。static TreePathgetPath(TreePath path, 树 target)返回由TreePath对象标识的子树内的树节点的树路径。Iterator<树>iterator()从叶到叶重迭。-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
构造方法详细信息
-
TreePath
public TreePath(CompilationUnitTree node)
为根节点创建一个TreePath。- 参数
-
node- 根节点
-
-
方法详细信息
-
getPath
public static TreePath getPath(CompilationUnitTree unit, 树 target)
返回编译单元中树节点的树路径,如果未找到该节点,则null。- 参数
-
unit- 要搜索的编译单元 -
target- 要定位的节点 - 结果
- 树路径
-
getPath
public static TreePath getPath(TreePath path, 树 target)
返回由TreePath对象标识的子树内的树节点的树路径。 如果找不到节点,则返回null。- 参数
-
path- 要搜索的路径 -
target- 要查找的节点 - 结果
- 目标节点的树路径
-
getCompilationUnit
public CompilationUnitTree getCompilationUnit()
返回与此路径关联的编译单元。- 结果
- 汇编单位
-
getLeaf
public 树 getLeaf()
返回此路径的叶节点。- 结果
- 叶节点
-
getParentPath
public TreePath getParentPath()
返回包围节点的路径,如果没有包围节点,则返回null。- 结果
- 封闭节点的路径
-
-