public class DocTreePath extends Object implements Iterable<DocTree>
DocCommentTree
node.Constructor | Description |
---|---|
DocTreePath |
Creates a DocTreePath for a child node. |
DocTreePath |
Creates a DocTreePath for a root node. |
Modifier and Type | Method | Description |
---|---|---|
DocCommentTree |
getDocComment() |
Returns the DocCommentTree associated with this path. |
DocTree |
getLeaf() |
Returns the leaf node for this path. |
DocTreePath |
getParentPath() |
Returns the path for the enclosing node, or null if there is no enclosing node. |
static DocTreePath |
getPath |
Returns a documentation tree path for a tree node within a subtree identified by a DocTreePath object, or null if the node is not found. |
static DocTreePath |
getPath |
Returns a documentation tree path for a tree node within a compilation unit, or null if the node is not found. |
TreePath |
getTreePath() |
Returns the TreePath associated with this path. |
Iterator |
iterator() |
Returns an iterator over elements of type T . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public DocTreePath(TreePath treePath, DocCommentTree t)
DocTreePath
for a root node.treePath
- the TreePath
from which the root node was createdt
- the DocCommentTree
to create the path forpublic DocTreePath(DocTreePath p, DocTree t)
DocTreePath
for a child node.p
- the parent nodet
- the child nodepublic static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target)
null
if the node is not found.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 commentpublic static DocTreePath getPath(DocTreePath path, DocTree target)
DocTreePath
object, or null
if the node is not found.path
- a path identifying a node within a doc comment treetarget
- a node to be located within the given nodepublic TreePath getTreePath()
TreePath
associated with this path.TreePath
for this DocTreePath
public DocCommentTree getDocComment()
DocCommentTree
associated with this path.DocCommentTree
for this DocTreePath
public DocTree getLeaf()
DocTree
for this DocTreePath
public DocTreePath getParentPath()
null
if there is no enclosing node.DocTreePath
of parentpublic Iterator<DocTree> iterator()
Iterable
T
.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/jdk.compiler/com/sun/source/util/DocTreePath.html