abstract class AbstractDepthFirstNodeListGenerator extends java.lang.Object implements DependencyVisitor
Actual vertex ordering (preorder, inorder, postorder) needs to be defined by subclasses through appropriate
implementations for visitEnter(org.eclipse.aether.graph.DependencyNode) and
visitLeave(org.eclipse.aether.graph.DependencyNode)
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<DependencyNode> |
nodes |
private java.util.Map<DependencyNode,java.lang.Object> |
visitedNodes |
| Constructor and Description |
|---|
AbstractDepthFirstNodeListGenerator() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Artifact> |
getArtifacts(boolean includeUnresolved)
Gets the artifacts associated with the list of dependency nodes generated during the graph traversal.
|
java.lang.String |
getClassPath()
Gets a class path by concatenating the artifact files of the visited dependency nodes.
|
java.util.List<Dependency> |
getDependencies(boolean includeUnresolved)
Gets the dependencies seen during the graph traversal.
|
java.util.List<java.io.File> |
getFiles()
Gets the files of resolved artifacts seen during the graph traversal.
|
java.util.List<DependencyNode> |
getNodes()
Gets the list of dependency nodes that was generated during the graph traversal.
|
protected boolean |
setVisited(DependencyNode node)
Marks the specified node as being visited and determines whether the node has been visited before.
|
abstract boolean |
visitEnter(DependencyNode node)
Notifies the visitor of a node visit before its children have been processed.
|
abstract boolean |
visitLeave(DependencyNode node)
Notifies the visitor of a node visit after its children have been processed.
|
private final java.util.Map<DependencyNode,java.lang.Object> visitedNodes
protected final java.util.List<DependencyNode> nodes
public java.util.List<DependencyNode> getNodes()
null.public java.util.List<Dependency> getDependencies(boolean includeUnresolved)
includeUnresolved - Whether unresolved dependencies shall be included in the result or not.null.public java.util.List<Artifact> getArtifacts(boolean includeUnresolved)
includeUnresolved - Whether unresolved artifacts shall be included in the result or not.null.public java.util.List<java.io.File> getFiles()
null.public java.lang.String getClassPath()
null.protected boolean setVisited(DependencyNode node)
node - The node being visited, must not be null.true if the node has not been visited before, false if the node was already visited.public abstract 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 abstract 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.