# Uses of Class
com.sun.source.util.TreePath

Packages that use TreePath
Package
Description
com.sun.source.util
Provides utilities for operations on abstract syntax trees (AST).

## Uses of TreePath in com.sun.source.util

Methods in com.sun.source.util that return TreePath
Modifier and Type
Method
Description
`TreePath`
TreePathScanner.`getCurrentPath()`
Returns the current path for the node, as built up by the currently active set of scan calls.
`TreePath`
TreePath.`getParentPath()`
Returns the path for the enclosing node, or `null` if there is no enclosing node.
`static TreePath`
TreePath.`getPath(CompilationUnitTree unit, Tree target)`
Returns a tree path for a tree node within a compilation unit, or `null` if the node is not found.
`static TreePath`
TreePath.`getPath(TreePath path, Tree target)`
Returns a tree path for a tree node within a subtree identified by a TreePath object.
`abstract TreePath`
Trees.`getPath(CompilationUnitTree unit, Tree node)`
Returns the path to tree node within the specified compilation unit.
`abstract TreePath`
Trees.`getPath(Element e)`
Returns the `TreePath` node for a given `Element`.
`abstract TreePath`
Trees.`getPath(Element e, AnnotationMirror a)`
Returns the `TreePath` node for an `AnnotationMirror` on a given `Element`.
`abstract TreePath`
Trees.`getPath(Element e, AnnotationMirror a, AnnotationValue v)`
Returns the `TreePath` node for an `AnnotationValue` for an `AnnotationMirror` on a given `Element`.
`TreePath`
DocTreePath.`getTreePath()`
Returns the `TreePath` associated with this path.
Methods in com.sun.source.util with parameters of type TreePath
Modifier and Type
Method
Description
`abstract String`
Trees.`getDocComment(TreePath path)`
Returns the doc comment, if any, for the `Tree` node identified by a given `TreePath`.
`abstract Elements.DocCommentKind`
DocTrees.`getDocCommentKind(TreePath path)`
Returns the style of the documentation comment associated with a tree node.
`abstract DocCommentTree`
DocTrees.`getDocCommentTree(TreePath path)`
Returns the doc comment tree, if any, for the Tree node identified by a given TreePath.
`abstract Element`
Trees.`getElement(TreePath path)`
Returns the `Element` for the `Tree` node identified by a given `TreePath`.
`static DocTreePath`
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.
`static TreePath`
TreePath.`getPath(TreePath path, Tree target)`
Returns a tree path for a tree node within a subtree identified by a TreePath object.
`abstract Scope`
Trees.`getScope(TreePath path)`
Returns the `Scope` for the `Tree` node identified by a given `TreePath`.
`abstract TypeMirror`
Trees.`getTypeMirror(TreePath path)`
Returns the `TypeMirror` for the `Tree` node identified by a given `TreePath`.
`R`
TreePathScanner.`scan(TreePath path, P p)`
Scans a tree from a position identified by a TreePath.
Constructors in com.sun.source.util with parameters of type TreePath
Modifier
Constructor
Description
``
`DocTreePath(TreePath treePath, DocCommentTree t)`
Creates a `DocTreePath` for a root node.
``
`TreePath(TreePath path, Tree tree)`
Creates a TreePath for a child node.