模块 jdk.compiler

类 DocTreePath

java.lang.Object
com.sun.source.util.DocTreePath
所有已实现的接口:
Iterable<DocTree>

public class DocTreePath extends Object implements Iterable <DocTree >
树节点的路径,通常用于表示树节点的祖先节点序列,直到顶级 DocCommentTree 节点。
自从:
1.8
  • 构造方法详细信息

    • DocTreePath

      public DocTreePath(TreePath  treePath, DocCommentTree  t)
      为根节点创建一个 DocTreePath
      参数:
      treePath - 创建根节点的 TreePath
      t - DocCommentTree 为其创建路径
    • DocTreePath

      public DocTreePath(DocTreePath  p, DocTree  t)
      为子节点创建一个 DocTreePath
      参数:
      p - 父节点
      t - 子节点
  • 方法详情

    • getPath

      public static DocTreePath  getPath(TreePath  treePath, DocCommentTree  doc, DocTree  target)
      返回编译单元内树节点的文档树路径,如果未找到该节点,则返回 null
      参数:
      treePath - 文档注释关联的节点的路径
      doc - 与节点关联的文档注释
      target - 文档注释中的节点
      返回:
      识别树中目标的路径
    • getPath

      public static DocTreePath  getPath(DocTreePath  path, DocTree  target)
      返回由 DocTreePath 对象标识的子树中树节点的文档树路径,如果未找到该节点,则返回 null
      参数:
      path - 标识文档评论树中节点的路径
      target - 位于给定节点内的节点
      返回:
      标识目标节点的路径
    • getTreePath

      public TreePath  getTreePath()
      返回与此路径关联的 TreePath
      返回:
      这个 DocTreePathTreePath
    • getDocComment

      public DocCommentTree  getDocComment()
      返回与此路径关联的 DocCommentTree
      返回:
      这个DocTreePathDocCommentTree
    • getLeaf

      public DocTree  getLeaf()
      返回此路径的叶节点。
      返回:
      这个DocTreePathDocTree
    • getParentPath

      public DocTreePath  getParentPath()
      返回封闭节点的路径,如果没有封闭节点,则返回 null
      返回:
      父母的DocTreePath
    • iterator

      public Iterator <DocTree > iterator()
      从接口 Iterable 复制的描述
      返回类型为 T 的元素的迭代器。
      指定者:
      iterator 在接口 Iterable<DocTree>
      返回:
      一个迭代器。