APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.source.util

public Class DocTreePath

extends Object
implements Iterable<DocTree>
Class Inheritance
All Implemented Interfaces
java.lang.Iterable
Imports
com.sun.source.doctree.DocCommentTree, .DocTree, java.util.Iterator, .NoSuchElementException, .Objects

A path of tree nodes, typically used to represent the sequence of ancestor nodes of a tree node up to the top-level DocCommentTree node.
Since
1.8

Field Summary

Modifier and TypeField and Description
private final DocCommentTree
private final DocTree
private final DocTreePath
private final TreePath

Constructor Summary

AccessConstructor and Description
public
DocTreePath(TreePath
the TreePath from which the root node was created
treePath
,
DocCommentTree
the DocCommentTree to create the path for
t
)

Creates a DocTreePath for a root node.

public
DocTreePath(DocTreePath
the parent node
p
,
DocTree
the child node
t
)

Creates a DocTreePath for a child node.

Method Summary

Modifier and TypeMethod and Description
public DocCommentTree

Returns:

the DocCommentTree for this DocTreePath
getDocComment
()

Returns the DocCommentTree associated with this path.

public DocTree

Returns:

the DocTree for this DocTreePath
getLeaf
()

Returns the leaf node for this path.

public DocTreePath

Returns:

DocTreePath of parent
getParentPath
()

Returns the path for the enclosing node, or null if there is no enclosing node.

public static DocTreePath

Returns:

a path identifying the target within the tree
getPath
(TreePath
the path for the node with which the doc comment is associated
treePath
,
DocCommentTree
the doc comment associated with the node
doc
,
DocTree
a node within the doc comment
target
)

Returns a documentation tree path for a tree node within a compilation unit, or null if the node is not found.

public static DocTreePath

Returns:

a path identifying the target node
getPath
(DocTreePath
a path identifying a node within a doc comment tree
path
,
DocTree
a node to be located within the given node
target
)

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.

public TreePath

Returns:

the TreePath for this DocTreePath
getTreePath
()

Returns the TreePath associated with this path.

public Iterator<DocTree>
iterator()

Implements java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

docCommentback to summary
private final DocCommentTree docComment
leafback to summary
private final DocTree leaf
parentback to summary
private final DocTreePath parent
treePathback to summary
private final TreePath treePath

Constructor Detail

DocTreePathback to summary
public DocTreePath(TreePath treePath, DocCommentTree t)

Creates a DocTreePath for a root node.

Parameters
treePath:TreePath

the TreePath from which the root node was created

t:DocCommentTree

the DocCommentTree to create the path for

DocTreePathback to summary
public DocTreePath(DocTreePath p, DocTree t)

Creates a DocTreePath for a child node.

Parameters
p:DocTreePath

the parent node

t:DocTree

the child node

Method Detail

getDocCommentback to summary
public DocCommentTree getDocComment()

Returns the DocCommentTree associated with this path.

Returns:DocCommentTree

the DocCommentTree for this DocTreePath

getLeafback to summary
public DocTree getLeaf()

Returns the leaf node for this path.

Returns:DocTree

the DocTree for this DocTreePath

getParentPathback to summary
public DocTreePath getParentPath()

Returns the path for the enclosing node, or null if there is no enclosing node.

Returns:DocTreePath

DocTreePath of parent

getPathback to summary
public static DocTreePath getPath(TreePath treePath, DocCommentTree doc, DocTree target)

Returns a documentation tree path for a tree node within a compilation unit, or null if the node is not found.

Parameters
treePath:TreePath

the path for the node with which the doc comment is associated

doc:DocCommentTree

the doc comment associated with the node

target:DocTree

a node within the doc comment

Returns:DocTreePath

a path identifying the target within the tree

getPathback to summary
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 null if the node is not found.

Parameters
path:DocTreePath

a path identifying a node within a doc comment tree

target:DocTree

a node to be located within the given node

Returns:DocTreePath

a path identifying the target node

getTreePathback to summary
public TreePath getTreePath()

Returns the TreePath associated with this path.

Returns:TreePath

the TreePath for this DocTreePath

iteratorback to summary
public Iterator<DocTree> iterator()

Implements java.lang.Iterable.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Annotations
@Override