org.sonatype.aether.util.graph
Class DefaultDependencyNode

java.lang.Object
  extended by org.sonatype.aether.util.graph.DefaultDependencyNode
All Implemented Interfaces:
DependencyNode

public class DefaultDependencyNode
extends Object
implements DependencyNode

A node within a dependency graph.

Author:
Benjamin Bentmann

Constructor Summary
DefaultDependencyNode()
          Creates an empty dependency node.
DefaultDependencyNode(Dependency dependency)
          Creates a new root node with the specified dependency.
DefaultDependencyNode(DependencyNode node)
          Creates a shallow clone of the specified node.
 
Method Summary
 boolean accept(DependencyVisitor visitor)
           
 Collection<Artifact> getAliases()
           
 List<DependencyNode> getChildren()
           
 Map<Object,Object> getData()
           
 Dependency getDependency()
           
 String getPremanagedScope()
           
 String getPremanagedVersion()
           
 List<Artifact> getRelocations()
           
 List<RemoteRepository> getRepositories()
           
 String getRequestContext()
           
 Version getVersion()
           
 VersionConstraint getVersionConstraint()
           
 void setAliases(Collection<Artifact> aliases)
          Sets the known aliases for this dependency's artifact.
 void setArtifact(Artifact artifact)
           
 void setData(Map<Object,Object> data)
           
 void setData(Object key, Object value)
           
 void setDependency(Dependency dependency)
           
 void setPremanagedScope(String premanagedScope)
          Sets the scope for this dependency before dependency management was applied (if any).
 void setPremanagedVersion(String premanagedVersion)
          Sets the version or version range for this dependency before dependency management was applied (if any).
 void setRelocations(List<Artifact> relocations)
          Sets the sequence of relocations that was followed to resolve this dependency's artifact.
 void setRepositories(List<RemoteRepository> repositories)
          Sets the remote repositories from which this node's artifact shall be resolved.
 void setRequestContext(String context)
           
 void setScope(String scope)
           
 void setVersion(Version version)
           
 void setVersionConstraint(VersionConstraint versionConstraint)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultDependencyNode

public DefaultDependencyNode()
Creates an empty dependency node.


DefaultDependencyNode

public DefaultDependencyNode(Dependency dependency)
Creates a new root node with the specified dependency.

Parameters:
dependency - The dependency associated with this node, may be null.

DefaultDependencyNode

public DefaultDependencyNode(DependencyNode node)
Creates a shallow clone of the specified node.

Parameters:
node - The node to copy, must not be null.
Method Detail

getChildren

public List<DependencyNode> getChildren()
Specified by:
getChildren in interface DependencyNode

getDependency

public Dependency getDependency()
Specified by:
getDependency in interface DependencyNode

setDependency

public void setDependency(Dependency dependency)

setArtifact

public void setArtifact(Artifact artifact)
Specified by:
setArtifact in interface DependencyNode

getRelocations

public List<Artifact> getRelocations()
Specified by:
getRelocations in interface DependencyNode

setRelocations

public void setRelocations(List<Artifact> relocations)
Sets the sequence of relocations that was followed to resolve this dependency's artifact.

Parameters:
relocations - The sequence of relocations, may be null.

getAliases

public Collection<Artifact> getAliases()
Specified by:
getAliases in interface DependencyNode

setAliases

public void setAliases(Collection<Artifact> aliases)
Sets the known aliases for this dependency's artifact.

Parameters:
aliases - The known aliases, may be null.

getVersionConstraint

public VersionConstraint getVersionConstraint()
Specified by:
getVersionConstraint in interface DependencyNode

setVersionConstraint

public void setVersionConstraint(VersionConstraint versionConstraint)

getVersion

public Version getVersion()
Specified by:
getVersion in interface DependencyNode

setVersion

public void setVersion(Version version)

setScope

public void setScope(String scope)
Specified by:
setScope in interface DependencyNode

getPremanagedVersion

public String getPremanagedVersion()
Specified by:
getPremanagedVersion in interface DependencyNode

setPremanagedVersion

public void setPremanagedVersion(String premanagedVersion)
Sets the version or version range for this dependency before dependency management was applied (if any).

Parameters:
premanagedVersion - The originally declared dependency version or null if the version was not managed.

getPremanagedScope

public String getPremanagedScope()
Specified by:
getPremanagedScope in interface DependencyNode

setPremanagedScope

public void setPremanagedScope(String premanagedScope)
Sets the scope for this dependency before dependency management was applied (if any).

Parameters:
premanagedScope - The originally declared dependency scope or null if the scope was not managed.

getRepositories

public List<RemoteRepository> getRepositories()
Specified by:
getRepositories in interface DependencyNode

setRepositories

public void setRepositories(List<RemoteRepository> repositories)
Sets the remote repositories from which this node's artifact shall be resolved.

Parameters:
repositories - The remote repositories to use for artifact resolution, may be null.

getRequestContext

public String getRequestContext()
Specified by:
getRequestContext in interface DependencyNode

setRequestContext

public void setRequestContext(String context)
Specified by:
setRequestContext in interface DependencyNode

getData

public Map<Object,Object> getData()
Specified by:
getData in interface DependencyNode

setData

public void setData(Map<Object,Object> data)

setData

public void setData(Object key,
                    Object value)
Specified by:
setData in interface DependencyNode

accept

public boolean accept(DependencyVisitor visitor)
Specified by:
accept in interface DependencyNode

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2011 Sonatype, Inc.. All Rights Reserved.