public class BuildingDependencyNodeVisitor extends java.lang.Object implements DependencyNodeVisitor
Modifier and Type | Field and Description |
---|---|
private java.util.Stack<DependencyNode> |
parentNodes
The resultant tree parent nodes for the currently visited node.
|
private DependencyNode |
rootNode
The root node of the resultant tree.
|
private DependencyNodeVisitor |
visitor
The dependency node visitor to apply on the resultant dependency tree, or
null for none. |
Constructor and Description |
---|
BuildingDependencyNodeVisitor()
Creates a dependency node visitor that clones visited nodes into a new dependency tree.
|
BuildingDependencyNodeVisitor(DependencyNodeVisitor visitor)
Creates a dependency node visitor that clones visited nodes into a new dependency tree, and then applies the
specified dependency node visitor on the resultant dependency tree.
|
Modifier and Type | Method and Description |
---|---|
boolean |
endVisit(DependencyNode node)
Ends the visit to to the specified dependency node.
|
DependencyNodeVisitor |
getDependencyNodeVisitor()
Gets the dependency node visitor that this visitor applies on the resultant dependency tree.
|
DependencyNode |
getDependencyTree()
Gets the root node of the resultant dependency tree constructed by this visitor.
|
boolean |
visit(DependencyNode node)
Starts the visit to the specified dependency node.
|
private final DependencyNodeVisitor visitor
null
for none.private final java.util.Stack<DependencyNode> parentNodes
private DependencyNode rootNode
public BuildingDependencyNodeVisitor()
public BuildingDependencyNodeVisitor(DependencyNodeVisitor visitor)
visitor
- the dependency node visitor to apply on the resultant dependency tree, or null
for
nonepublic boolean visit(DependencyNode node)
visit
in interface DependencyNodeVisitor
node
- the dependency node to visittrue
to visit the specified dependency node's children, false
to skip the
specified dependency node's children and proceed to its next siblingpublic boolean endVisit(DependencyNode node)
endVisit
in interface DependencyNodeVisitor
node
- the dependency node to visittrue
to visit the specified dependency node's next sibling, false
to skip the
specified dependency node's next siblings and proceed to its parentpublic DependencyNodeVisitor getDependencyNodeVisitor()
null
for nonepublic DependencyNode getDependencyTree()
null
if the source tree has not yet been visited