DocTreePath (Java SE 10 & JDK 10 )
- java.lang.Object
-
- com.sun.source.util.DocTreePath
-
-
Constructor Summary
Constructors Constructor Description DocTreePath(DocTreePath p, DocTree t)Creates a DocTreePath for a child node.
DocTreePath(TreePath treePath, DocCommentTree t)Creates a DocTreePath for a root node.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DocCommentTreegetDocComment()Returns the DocCommentTree associated with this path.
DocTreegetLeaf()Returns the leaf node for this path.
DocTreePathgetParentPath()Returns the path for the enclosing node, or
nullif there is no enclosing node.static DocTreePathgetPath(DocTreePath path, DocTree target)Returns a documentation tree path for a tree node within a subtree identified by a DocTreePath object, or
nullif the node is not found.static DocTreePathgetPath(TreePath treePath, DocCommentTree doc, DocTree target)Returns a documentation tree path for a tree node within a compilation unit, or
nullif the node is not found.TreePathgetTreePath()Returns the TreePath associated with this path.
-
Methods declared in interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Constructor Detail
-
DocTreePath
public DocTreePath(TreePath treePath, DocCommentTree t)
Creates a DocTreePath for a root node.
- Parameters:
treePath- the TreePath from which the root node was created.t- the DocCommentTree to create the path for.
-
DocTreePath
public DocTreePath(DocTreePath p, DocTree t)
Creates a DocTreePath for a child node.
- Parameters:
p- the parent nodet- the child node
-
-
Method Detail
-
getPath
public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target)
Returns a documentation tree path for a tree node within a compilation unit, or
nullif the node is not found.- Parameters:
treePath- the path for the node with which the doc comment is associateddoc- the doc comment associated with the nodetarget- a node within the doc comment- Returns:
- a path identifying the target within the tree
-
getPath
public static DocTreePath getPath(DocTreePath path, DocTree target)
Returns a documentation tree path for a tree node within a subtree identified by a DocTreePath object, or
nullif the node is not found.- Parameters:
path- a path identifying a node within a doc comment treetarget- a node to be located within the given node- Returns:
- a path identifying the target node
-
getTreePath
public TreePath getTreePath()
Returns the TreePath associated with this path.
- Returns:
- the TreePath for this DocTreePath
-
getDocComment
public DocCommentTree getDocComment()
Returns the DocCommentTree associated with this path.
- Returns:
- the DocCommentTree for this DocTreePath
-
getLeaf
public DocTree getLeaf()
Returns the leaf node for this path.
- Returns:
- the DocTree for this DocTreePath
-
getParentPath
public DocTreePath getParentPath()
Returns the path for the enclosing node, or
nullif there is no enclosing node.- Returns:
- DocTreePath of parent
-
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.