DependencyNodepublic final class DefaultDependencyNode extends java.lang.Object implements DependencyNode
MANAGED_EXCLUSIONS, MANAGED_OPTIONAL, MANAGED_PROPERTIES, MANAGED_SCOPE, MANAGED_VERSION| Constructor | Description |
|---|---|
DefaultDependencyNode(Artifact artifact) |
Creates a new root node with the specified artifact as its label.
|
DefaultDependencyNode(Dependency dependency) |
Creates a new node with the specified dependency.
|
DefaultDependencyNode(DependencyNode node) |
Creates a mostly shallow clone of the specified node.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
accept(DependencyVisitor visitor) |
Traverses this node and potentially its children using the specified visitor.
|
java.util.Collection<? extends Artifact> |
getAliases() |
Gets the known aliases for this dependency's artifact.
|
Artifact |
getArtifact() |
Gets the artifact associated with this node.
|
java.util.List<DependencyNode> |
getChildren() |
Gets the child nodes of this node.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getData() |
Gets the custom data associated with this dependency node.
|
Dependency |
getDependency() |
Gets the dependency associated with this node.
|
int |
getManagedBits() |
Gets a bit field indicating which attributes of this node were subject to dependency management.
|
java.util.List<? extends Artifact> |
getRelocations() |
Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.
|
java.util.List<RemoteRepository> |
getRepositories() |
Gets the remote repositories from which this node's artifact shall be resolved.
|
java.lang.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(java.util.Collection<? extends Artifact> aliases) |
Sets the known aliases for this dependency's artifact.
|
void |
setArtifact(Artifact artifact) |
Updates the artifact of the dependency after resolution.
|
void |
setChildren(java.util.List<DependencyNode> children) |
Sets the child nodes of this node.
|
void |
setData(java.lang.Object key,
java.lang.Object value) |
Associates the specified dependency node data with the given key.
|
void |
setData(java.util.Map<java.lang.Object,java.lang.Object> data) |
Sets the custom data associated with this dependency node.
|
void |
setManagedBits(int managedBits) |
Sets a bit field indicating which attributes of this node were subject to dependency management.
|
void |
setOptional(java.lang.Boolean optional) |
Sets the optional flag of the dependency.
|
void |
setRelocations(java.util.List<? extends Artifact> relocations) |
Sets the sequence of relocations that was followed to resolve this dependency's artifact.
|
void |
setRepositories(java.util.List<RemoteRepository> repositories) |
Sets the remote repositories from which this node's artifact shall be resolved.
|
void |
setRequestContext(java.lang.String context) |
Sets the request context in which this dependency node was created.
|
void |
setScope(java.lang.String scope) |
Sets the scope of the dependency.
|
void |
setVersion(Version version) |
Sets the version that was selected for the dependency's target artifact.
|
void |
setVersionConstraint(VersionConstraint versionConstraint) |
Sets the version constraint that was parsed from the dependency's version declaration.
|
java.lang.String |
toString() |
public DefaultDependencyNode(Dependency dependency)
dependency - The dependency associated with this node, may be null for a root node.public DefaultDependencyNode(Artifact artifact)
getDependency() will return null. Put differently, the specified artifact will not be subject to
dependency collection/resolution.artifact - The artifact to use as label for this node, may be null.public DefaultDependencyNode(DependencyNode node)
node - The node to copy, must not be null.public java.util.List<DependencyNode> getChildren()
DependencyNodegetChildren in interface DependencyNodenull.public void setChildren(java.util.List<DependencyNode> children)
DependencyNodesetChildren in interface DependencyNodechildren - The child nodes, may be nullpublic Dependency getDependency()
DependencyNodenull when invoked on the graph's root node. The root
node of such graphs may however still have a label as returned by DependencyNode.getArtifact().getDependency in interface DependencyNodenull if none.public Artifact getArtifact()
DependencyNodegetDependency().getArtifact(). Otherwise the artifact merely provides a label for this node in which case
the artifact must not be subjected to dependency collection/resolution.getArtifact in interface DependencyNodenull if none.public void setArtifact(Artifact artifact)
DependencyNodeDependencyNode.getDependency() is not null.setArtifact in interface DependencyNodeartifact - The artifact satisfying the dependency, must not be null.public java.util.List<? extends Artifact> getRelocations()
DependencyNodegetRelocations in interface DependencyNodenull.public void setRelocations(java.util.List<? extends Artifact> relocations)
relocations - The sequence of relocations, may be null.public java.util.Collection<? extends Artifact> getAliases()
DependencyNodegetAliases in interface DependencyNodenull.public void setAliases(java.util.Collection<? extends Artifact> aliases)
aliases - The known aliases, may be null.public VersionConstraint getVersionConstraint()
DependencyNodegetVersionConstraint in interface DependencyNodenull.public void setVersionConstraint(VersionConstraint versionConstraint)
versionConstraint - The version constraint for this node, may be null.public Version getVersion()
DependencyNodegetVersion in interface DependencyNodenull.public void setVersion(Version version)
version - The parsed version, may be null.public void setScope(java.lang.String scope)
DependencyNodeDependencyNode.getDependency() is not null.setScope in interface DependencyNodescope - The scope, may be null.public void setOptional(java.lang.Boolean optional)
DependencyNodeDependencyNode.getDependency() is not null.setOptional in interface DependencyNodeoptional - The optional flag, may be null.public int getManagedBits()
DependencyNodegetManagedBits in interface DependencyNodeDependencyNode.MANAGED_VERSION, DependencyNode.MANAGED_SCOPE,
DependencyNode.MANAGED_OPTIONAL, DependencyNode.MANAGED_PROPERTIES and DependencyNode.MANAGED_EXCLUSIONS if the
corresponding attribute was set via dependency management.public void setManagedBits(int managedBits)
managedBits - The bit field indicating the managed attributes or 0 if dependency management wasn't
applied.public java.util.List<RemoteRepository> getRepositories()
DependencyNodegetRepositories in interface DependencyNodenull.public void setRepositories(java.util.List<RemoteRepository> repositories)
repositories - The remote repositories to use for artifact resolution, may be null.public java.lang.String getRequestContext()
DependencyNodegetRequestContext in interface DependencyNodenull.public void setRequestContext(java.lang.String context)
DependencyNodesetRequestContext in interface DependencyNodecontext - The context, may be null.public java.util.Map<java.lang.Object,java.lang.Object> getData()
DependencyNodeDependencyNode.setData(Object, Object) needs to be used to update the custom data.getData in interface DependencyNodenull.public void setData(java.util.Map<java.lang.Object,java.lang.Object> data)
DependencyNodesetData in interface DependencyNodedata - The new custom data, may be null.public void setData(java.lang.Object key, java.lang.Object value)
DependencyNodeDependencyNode.getData() is being iterated.setData in interface DependencyNodekey - 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)
DependencyNodeaccept in interface DependencyNodevisitor - The visitor to call back, must not be null.true to visit siblings nodes of this node as well, false to skip siblings.public java.lang.String toString()
toString in class java.lang.Object