public final class DefaultDependencyNode extends Object implements DependencyNode
MANAGED_EXCLUSIONS, MANAGED_OPTIONAL, MANAGED_PROPERTIES, MANAGED_SCOPE, MANAGED_VERSION| Constructor and 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 and Description | 
|---|---|
| boolean | accept(DependencyVisitor visitor)Traverses this node and potentially its children using the specified visitor. | 
| Collection<? extends Artifact> | getAliases()Gets the known aliases for this dependency's artifact. | 
| Artifact | getArtifact()Gets the artifact associated with this node. | 
| 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. | 
| int | getManagedBits()Gets a bit field indicating which attributes of this node were subject to dependency management. | 
| List<? extends 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<? 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(List<DependencyNode> children)Sets the child nodes of this node. | 
| void | setData(Map<Object,Object> data)Sets the custom data associated with this dependency node. | 
| void | setData(Object key,
              Object value)Associates the specified dependency node data with the given key. | 
| void | setManagedBits(int managedBits)Sets a bit field indicating which attributes of this node were subject to dependency management. | 
| void | setOptional(Boolean optional)Sets the optional flag of the dependency. | 
| void | setRelocations(List<? extends 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)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. | 
| 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 List<DependencyNode> getChildren()
DependencyNodegetChildren in interface DependencyNodenull.public void setChildren(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 List<? extends Artifact> getRelocations()
DependencyNodegetRelocations in interface DependencyNodenull.public void setRelocations(List<? extends Artifact> relocations)
relocations - The sequence of relocations, may be null.public Collection<? extends Artifact> getAliases()
DependencyNodegetAliases in interface DependencyNodenull.public void setAliases(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(String scope)
DependencyNodeDependencyNode.getDependency() is not null.setScope in interface DependencyNodescope - The scope, may be null.public void setOptional(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 List<RemoteRepository> getRepositories()
DependencyNodegetRepositories in interface DependencyNodenull.public void setRepositories(List<RemoteRepository> repositories)
repositories - The remote repositories to use for artifact resolution, may be null.public String getRequestContext()
DependencyNodegetRequestContext in interface DependencyNodenull.public void setRequestContext(String context)
DependencyNodesetRequestContext in interface DependencyNodecontext - The context, may be null.public Map<Object,Object> getData()
DependencyNodeDependencyNode.setData(Object, Object) needs to be used to update the custom data.getData in interface DependencyNodenull.public void setData(Map<Object,Object> data)
DependencyNodesetData in interface DependencyNodedata - The new custom data, may be null.public void setData(Object key, 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.Copyright © 2010–2018 The Apache Software Foundation. All rights reserved.