public class CloningDependencyVisitor extends Object implements DependencyVisitor
FilteringDependencyVisitor
, a sub graph can be created. This class creates shallow clones of the visited
dependency nodes (via DefaultDependencyNode(DependencyNode)
) but clients can create a
subclass and override clone(DependencyNode)
to alter the clone process.Constructor and Description |
---|
CloningDependencyVisitor()
Creates a new visitor that clones the visited nodes.
|
Modifier and Type | Method and Description |
---|---|
protected DependencyNode |
clone(DependencyNode node)
Creates a clone of the specified node.
|
DependencyNode |
getRootNode()
Gets the root node of the cloned dependency graph.
|
boolean |
visitEnter(DependencyNode node)
Notifies the visitor of a node visit before its children have been processed.
|
boolean |
visitLeave(DependencyNode node)
Notifies the visitor of a node visit after its children have been processed.
|
public CloningDependencyVisitor()
public final DependencyNode getRootNode()
null
.protected DependencyNode clone(DependencyNode node)
node
- The node to clone, must not be null
.null
.public final boolean visitEnter(DependencyNode node)
DependencyVisitor
visitEnter
in interface DependencyVisitor
node
- The dependency node being visited, must not be null
.true
to visit child nodes of the specified node as well, false
to skip children.public final boolean visitLeave(DependencyNode node)
DependencyVisitor
visitLeave
in interface DependencyVisitor
node
- The dependency node being visited, must not be null
.true
to visit siblings nodes of the specified node as well, false
to skip siblings.Copyright © 2010–2022 The Apache Software Foundation. All rights reserved.