org.universAAL.maven
Class IndexingDependencyNodeVisitor

Package class diagram package IndexingDependencyNodeVisitor
java.lang.Object
  extended by org.universAAL.maven.FilteringVisitorSupport
      extended by org.universAAL.maven.IndexingDependencyNodeVisitor
All Implemented Interfaces:
org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor

public class IndexingDependencyNodeVisitor
extends FilteringVisitorSupport
implements org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor

This DepepdencyVistor traverses depedency tree in depth-first manner. All nodes which were not ommited are remembered in two maps: nodesByArtifactId and versionsByArtifactId. Maps are available after search is finished.

Author:
rotgier

Constructor Summary
IndexingDependencyNodeVisitor(org.apache.maven.plugin.logging.Log log)
          Constructor of IndexingDependencyNodeVisitor.
 
Method Summary
 boolean endVisit(org.apache.maven.shared.dependency.tree.DependencyNode node)
          If this method returns true then it means that the next sibling should be visited.
 Map getNodesByArtifactId()
          Gets mapping of stringified artifacts (groupId + artifactId + version) to nodes in the dependency tree.
 Map getVersionByArtifactId()
          Gets mapping of stringified artifacts without version (groupId + artifactId) to stringified artifacts with version.
 boolean visit(org.apache.maven.shared.dependency.tree.DependencyNode node)
          If this method returns true then it means that nodes children should be visited.
 
Methods inherited from class org.universAAL.maven.FilteringVisitorSupport
getLog, getVisited, isInScope, stringify, stringify, stringifyNoVersion, stringifyNoVersion, wasVisited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexingDependencyNodeVisitor

public IndexingDependencyNodeVisitor(org.apache.maven.plugin.logging.Log log)
Constructor of IndexingDependencyNodeVisitor.

Parameters:
log - object used for logging.
Method Detail

visit

public final boolean visit(org.apache.maven.shared.dependency.tree.DependencyNode node)
If this method returns true then it means that nodes children should be visited. True is returned only if node is in scope and if it was not ommited. It is ensured that node with given groupId, artifactId and version is visited only once.

Specified by:
visit in interface org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor
Parameters:
node - which should be checked for need of visiting
Returns:
true if node needs visiting, false otherwise

endVisit

public final boolean endVisit(org.apache.maven.shared.dependency.tree.DependencyNode node)
If this method returns true then it means that the next sibling should be visited. Because all nodes should be visited this methods always returns true.

Specified by:
endVisit in interface org.apache.maven.shared.dependency.tree.traversal.DependencyNodeVisitor
Parameters:
node - which visiting should be finished
Returns:
this method always returns true

getNodesByArtifactId

public final Map getNodesByArtifactId()
Gets mapping of stringified artifacts (groupId + artifactId + version) to nodes in the dependency tree. Nodes contain information about children. Duplicates of nodes are not included in the mapping.

Returns:
the map

getVersionByArtifactId

public final Map getVersionByArtifactId()
Gets mapping of stringified artifacts without version (groupId + artifactId) to stringified artifacts with version.

Returns:
the map


Copyright © 2014 universAAL Consortium. All Rights Reserved.