public final class PathRecordingDependencyVisitor extends java.lang.Object implements DependencyVisitor
| Modifier and Type | Field and Description |
|---|---|
private boolean |
excludeChildrenOfMatches |
private DependencyFilter |
filter |
private Stack<DependencyNode> |
parents |
private java.util.List<java.util.List<DependencyNode>> |
paths |
private java.util.Map<DependencyNode,java.lang.Object> |
visited |
| Constructor and Description |
|---|
PathRecordingDependencyVisitor(DependencyFilter filter)
Creates a new visitor that uses the specified filter to identify terminal nodes of interesting paths.
|
PathRecordingDependencyVisitor(DependencyFilter filter,
boolean excludeChildrenOfMatches)
Creates a new visitor that uses the specified filter to identify terminal nodes of interesting paths.
|
| Modifier and Type | Method and Description |
|---|---|
DependencyFilter |
getFilter()
Gets the filter being used to select terminal nodes.
|
java.util.List<java.util.List<DependencyNode>> |
getPaths()
Gets the paths leading to nodes matching the filter that have been recorded during the graph visit.
|
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.
|
private final DependencyFilter filter
private final java.util.List<java.util.List<DependencyNode>> paths
private final Stack<DependencyNode> parents
private final java.util.Map<DependencyNode,java.lang.Object> visited
private final boolean excludeChildrenOfMatches
public PathRecordingDependencyVisitor(DependencyFilter filter)
filter - The filter used to select terminal nodes of paths to record, may be null to match any node.public PathRecordingDependencyVisitor(DependencyFilter filter, boolean excludeChildrenOfMatches)
filter - The filter used to select terminal nodes of paths to record, may be null to match any node.excludeChildrenOfMatches - Flag controlling whether children of matched nodes should be excluded from the
traversal, thereby ignoring any potential paths to other matching nodes beneath a matching ancestor
node. If true, all recorded paths will have only one matching node (namely the terminal node),
if false a recorded path can consist of multiple matching nodes.public DependencyFilter getFilter()
null if none.public java.util.List<java.util.List<DependencyNode>> getPaths()
null.public boolean visitEnter(DependencyNode node)
DependencyVisitorvisitEnter in interface DependencyVisitornode - 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 boolean visitLeave(DependencyNode node)
DependencyVisitorvisitLeave in interface DependencyVisitornode - The dependency node being visited, must not be null.true to visit siblings nodes of the specified node as well, false to skip siblings.