Class BuildingDependencyNodeVisitor
- java.lang.Object
-
- org.apache.maven.shared.dependency.graph.traversal.BuildingDependencyNodeVisitor
-
- All Implemented Interfaces:
DependencyNodeVisitor
public class BuildingDependencyNodeVisitor extends Object implements DependencyNodeVisitor
A dependency node visitor that clones visited nodes into a new dependency tree. This can be used in conjunction with a dependency node filter to construct subtrees.- Author:
- Mark Hobson
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanendVisit(DependencyNode node)Ends the visit to to the specified dependency node.DependencyNodeVisitorgetDependencyNodeVisitor()Gets the dependency node visitor that this visitor applies on the resultant dependency tree.DependencyNodegetDependencyTree()Gets the root node of the resultant dependency tree constructed by this visitor.booleanvisit(DependencyNode node)Starts the visit to the specified dependency node.
-
-
-
Constructor Detail
-
BuildingDependencyNodeVisitor
public BuildingDependencyNodeVisitor()
Creates a dependency node visitor that clones visited nodes into a new dependency tree.
-
BuildingDependencyNodeVisitor
public 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.- Parameters:
visitor- the dependency node visitor to apply on the resultant dependency tree, ornullfor none
-
-
Method Detail
-
visit
public boolean visit(DependencyNode node)
Starts the visit to the specified dependency node.- Specified by:
visitin interfaceDependencyNodeVisitor- Parameters:
node- the dependency node to visit- Returns:
trueto visit the specified dependency node's children,falseto skip the specified dependency node's children and proceed to its next sibling
-
endVisit
public boolean endVisit(DependencyNode node)
Ends the visit to to the specified dependency node.- Specified by:
endVisitin interfaceDependencyNodeVisitor- Parameters:
node- the dependency node to visit- Returns:
trueto visit the specified dependency node's next sibling,falseto skip the specified dependency node's next siblings and proceed to its parent
-
getDependencyNodeVisitor
public DependencyNodeVisitor getDependencyNodeVisitor()
Gets the dependency node visitor that this visitor applies on the resultant dependency tree.- Returns:
- the dependency node visitor, or
nullfor none
-
getDependencyTree
public DependencyNode getDependencyTree()
Gets the root node of the resultant dependency tree constructed by this visitor.- Returns:
- the root node, or
nullif the source tree has not yet been visited
-
-