Class AbstractDepthFirstNodeListGenerator
java.lang.Object
org.eclipse.aether.util.graph.visitor.AbstractDepthFirstNodeListGenerator
- All Implemented Interfaces:
DependencyVisitor
- Direct Known Subclasses:
PostorderNodeListGenerator,PreorderNodeListGenerator
Abstract base class for depth first dependency tree traversers. Subclasses of this visitor will visit each node
exactly once regardless how many paths within the dependency graph lead to the node such that the resulting node
sequence is free of duplicates.
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)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<DependencyNode> private final Map<DependencyNode, Object> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetArtifacts(boolean includeUnresolved) Gets the artifacts associated with the list of dependency nodes generated during the graph traversal.Gets a class path by concatenating the artifact files of the visited dependency nodes.getDependencies(boolean includeUnresolved) Gets the dependencies seen during the graph traversal.getFiles()Gets the files of resolved artifacts seen during the graph traversal.getNodes()Gets the list of dependency nodes that was generated during the graph traversal.protected booleansetVisited(DependencyNode node) Marks the specified node as being visited and determines whether the node has been visited before.abstract booleanvisitEnter(DependencyNode node) Notifies the visitor of a node visit before its children have been processed.abstract booleanvisitLeave(DependencyNode node) Notifies the visitor of a node visit after its children have been processed.
-
Field Details
-
visitedNodes
-
nodes
-
-
Constructor Details
-
AbstractDepthFirstNodeListGenerator
AbstractDepthFirstNodeListGenerator()
-
-
Method Details
-
getNodes
Gets the list of dependency nodes that was generated during the graph traversal.- Returns:
- The list of dependency nodes, never
null.
-
getDependencies
Gets the dependencies seen during the graph traversal.- Parameters:
includeUnresolved- Whether unresolved dependencies shall be included in the result or not.- Returns:
- The list of dependencies, never
null.
-
getArtifacts
Gets the artifacts associated with the list of dependency nodes generated during the graph traversal.- Parameters:
includeUnresolved- Whether unresolved artifacts shall be included in the result or not.- Returns:
- The list of artifacts, never
null.
-
getFiles
Gets the files of resolved artifacts seen during the graph traversal.- Returns:
- The list of artifact files, never
null.
-
getClassPath
Gets a class path by concatenating the artifact files of the visited dependency nodes. Nodes with unresolved artifacts are automatically skipped.- Returns:
- The class path, using the platform-specific path separator, never
null.
-
setVisited
Marks the specified node as being visited and determines whether the node has been visited before.- Parameters:
node- The node being visited, must not benull.- Returns:
trueif the node has not been visited before,falseif the node was already visited.
-
visitEnter
Description copied from interface:DependencyVisitorNotifies the visitor of a node visit before its children have been processed.- Specified by:
visitEnterin interfaceDependencyVisitor- Parameters:
node- The dependency node being visited, must not benull.- Returns:
trueto visit child nodes of the specified node as well,falseto skip children.
-
visitLeave
Description copied from interface:DependencyVisitorNotifies the visitor of a node visit after its children have been processed. Note that this method is always invoked regardless whether any children have actually been visited.- Specified by:
visitLeavein interfaceDependencyVisitor- Parameters:
node- The dependency node being visited, must not benull.- Returns:
trueto visit siblings nodes of the specified node as well,falseto skip siblings.
-