public class TestDependencyNode extends Object implements DependencyNode
Constructor and Description |
---|
TestDependencyNode()
Creates an empty dependency node.
|
TestDependencyNode(Dependency dependency)
Creates a new root node with the specified dependency.
|
TestDependencyNode(DependencyNode node)
Creates a shallow clone of the specified node.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(DependencyVisitor visitor)
Traverses this node and potentially its children using the specified visitor.
|
Collection<Artifact> |
getAliases()
Gets the known aliases for this dependency's artifact.
|
List<DependencyNode> |
getChildren()
Gets the child nodes of this node.
|
Map<Object,Object> |
getData()
Gets the custom data associated with this dependency node.
|
Dependency |
getDependency()
Gets the dependency associated with this node.
|
String |
getPremanagedScope()
Gets the scope for the dependency before dependency management was applied (if any).
|
String |
getPremanagedVersion()
Gets the version or version range for the dependency before dependency management was applied (if any).
|
List<Artifact> |
getRelocations()
Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.
|
List<RemoteRepository> |
getRepositories()
Gets the remote repositories from which this node's artifact shall be resolved.
|
String |
getRequestContext()
Gets the request context in which this dependency node was created.
|
Version |
getVersion()
Gets the version that was selected for the dependency's target artifact.
|
VersionConstraint |
getVersionConstraint()
Gets the version constraint that was parsed from the dependency's version declaration.
|
void |
setAliases(Collection<Artifact> aliases)
Sets the known aliases for this dependency's artifact.
|
void |
setArtifact(Artifact artifact)
Sets the artifact of the dependency.
|
void |
setData(Object key,
Object value)
Associates the specified dependency node data with the given key.
|
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)
Sets the request context in which this dependency node was created.
|
void |
setScope(String scope)
Sets the scope of the dependency.
|
void |
setVersion(Version version) |
void |
setVersionConstraint(VersionConstraint versionConstraint) |
String |
toString() |
public TestDependencyNode()
public TestDependencyNode(Dependency dependency)
dependency
- The dependency associated with this node, may be null
.public TestDependencyNode(DependencyNode node)
node
- The node to copy, must not be null
.public List<DependencyNode> getChildren()
DependencyNode
getChildren
in interface DependencyNode
null
.public Dependency getDependency()
DependencyNode
getDependency
in interface DependencyNode
null
if none.public void setDependency(Dependency dependency)
public void setArtifact(Artifact artifact)
DependencyNode
setArtifact
in interface DependencyNode
artifact
- The artifact satisfying the dependency, must not be null
.public List<Artifact> getRelocations()
DependencyNode
getRelocations
in interface DependencyNode
null
.public void setRelocations(List<Artifact> relocations)
relocations
- The sequence of relocations, may be null
.public Collection<Artifact> getAliases()
DependencyNode
getAliases
in interface DependencyNode
null
.public void setAliases(Collection<Artifact> aliases)
aliases
- The known aliases, may be null
.public VersionConstraint getVersionConstraint()
DependencyNode
getVersionConstraint
in interface DependencyNode
null
.public void setVersionConstraint(VersionConstraint versionConstraint)
public Version getVersion()
DependencyNode
getVersion
in interface DependencyNode
null
.public void setVersion(Version version)
public void setScope(String scope)
DependencyNode
setScope
in interface DependencyNode
scope
- The scope, may be null
.public String getPremanagedVersion()
DependencyNode
getPremanagedVersion
in interface DependencyNode
null
if the version was not managed.public void setPremanagedVersion(String premanagedVersion)
premanagedVersion
- The originally declared dependency version or null
if the version was not
managed.public String getPremanagedScope()
DependencyNode
getPremanagedScope
in interface DependencyNode
null
if the scope was not managed.public void setPremanagedScope(String premanagedScope)
premanagedScope
- The originally declared dependency scope or null
if the scope was not managed.public List<RemoteRepository> getRepositories()
DependencyNode
getRepositories
in interface DependencyNode
null
.public void setRepositories(List<RemoteRepository> repositories)
repositories
- The remote repositories to use for artifact resolution, may be null
.public String getRequestContext()
DependencyNode
getRequestContext
in interface DependencyNode
null
.public void setRequestContext(String context)
DependencyNode
setRequestContext
in interface DependencyNode
context
- The context, may be null
.public Map<Object,Object> getData()
DependencyNode
getData
in interface DependencyNode
null
.public void setData(Object key, Object value)
DependencyNode
DependencyNode.getData()
is being iterated.setData
in interface DependencyNode
key
- The key under which to store the data, must not be null
.value
- The data to associate with the key, may be null
to remove the mapping.public boolean accept(DependencyVisitor visitor)
DependencyNode
accept
in interface DependencyNode
visitor
- The visitor to call back, must not be null
.true
to visit siblings nodes of this node as well, false
to skip siblings.Copyright © 2010-2012 Sonatype, Inc.. All Rights Reserved.