org.codehaus.mojo.pomtools.helpers
Class TransitiveDependencyInfo

java.lang.Object
  extended by org.codehaus.mojo.pomtools.helpers.TransitiveDependencyInfo

public class TransitiveDependencyInfo
extends Object

This class is used my MetadataHelper.getTransitiveDependencies(). An instance is created for every possible transitive dependency (whether it is used or not). The getResolutionNodes() represent each possible path that this groupId:artifactId:type are included into a project. The "selectedNode" is the actual resolutionNode instance that maven is using during a build.

Version:
$Id: TransitiveDependencyInfo.java 2166 2006-07-18 21:32:16Z carlos $
Author:
David Hawkins

Nested Class Summary
static class TransitiveDependencyInfo.VersionCount
           
 
Constructor Summary
TransitiveDependencyInfo(org.apache.maven.artifact.resolver.ResolutionNode node)
           
 
Method Summary
 void addResolutionNode(org.apache.maven.artifact.resolver.ResolutionNode pathNode)
          Adds a resolution node to the list.
 List getDistinctVersionCounts()
          Returns a sorted list of distinct versions from all of the ResolutionNodes and the number of occurances.
 TreeNode getInclusionTree()
          Returns an object tree of all of the possible paths which can transitively include this artifact.
 String getKey()
           
 List getResolutionNodes()
           
 org.apache.maven.artifact.Artifact getSelectedArtifact()
           
 org.apache.maven.artifact.resolver.ResolutionNode getSelectedNode()
          Returns the node used in the constructor which represents the actual dependency that was resolved for the project.
 boolean hasConflicts()
          Returns wheter any of the possible transitive dependencies for this groupId:artifactId:type have a different version than the "selectedNode" which maven is using for the build.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransitiveDependencyInfo

public TransitiveDependencyInfo(org.apache.maven.artifact.resolver.ResolutionNode node)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getSelectedArtifact

public org.apache.maven.artifact.Artifact getSelectedArtifact()

getResolutionNodes

public List getResolutionNodes()

addResolutionNode

public void addResolutionNode(org.apache.maven.artifact.resolver.ResolutionNode pathNode)
Adds a resolution node to the list. If the artifact version from the new node differs from the artifact version of the "selectedNode", this object is noted as having conflicting versions.

If the version strings do not match literally, A version range is created and the item being added is tested to see if it's range includes the "selectedNode" version. If so, it is not considered a conflict.

Parameters:
pathNode -

getSelectedNode

public org.apache.maven.artifact.resolver.ResolutionNode getSelectedNode()
Returns the node used in the constructor which represents the actual dependency that was resolved for the project.

Returns:

getKey

public String getKey()

hasConflicts

public boolean hasConflicts()
Returns wheter any of the possible transitive dependencies for this groupId:artifactId:type have a different version than the "selectedNode" which maven is using for the build.


getDistinctVersionCounts

public List getDistinctVersionCounts()
Returns a sorted list of distinct versions from all of the ResolutionNodes and the number of occurances.

Returns:
a list of TransitiveDependencyInfo.VersionCount objects

getInclusionTree

public TreeNode getInclusionTree()
                          throws PomToolsException
Returns an object tree of all of the possible paths which can transitively include this artifact. The root immediate children of the root node of the resulting tree will be the directly included dependencies which lead to this artifact.

Returns:
Throws:
PomToolsException


Copyright © 2011 The Codehaus. All Rights Reserved.