- java.lang.Object
-
- com.sun.source.util.TreePath
-
-
构造方法摘要
构造方法 构造器 描述 TreePath(CompilationUnitTree node)为根节点创建TreePath。TreePath(TreePath path, 树 tree)为子节点创建TreePath。
-
方法摘要
所有方法 静态方法 实例方法 具体的方法 变量和类型 方法 描述 CompilationUnitTreegetCompilationUnit()返回与此路径关联的编译单元。树getLeaf()返回此路径的叶节点。TreePathgetParentPath()返回封闭节点的路径,如果没有封闭节点,则返回null。static TreePathgetPath(CompilationUnitTree unit, 树 target)返回编译单元中树节点的树路径,如果找不到节点,则null。static TreePathgetPath(TreePath path, 树 target)返回TreePath对象标识的子树中树节点的树路径。Iterator<树>iterator()从叶到根迭代。-
声明方法的类 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
声明方法的接口 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。- 结果
- 封闭节点的路径
-
-