Package org.eclipse.aether.graph
Class DefaultDependencyNode
java.lang.Object
org.eclipse.aether.graph.DefaultDependencyNode
- All Implemented Interfaces:
- DependencyNode
A node within a dependency graph.
- 
Field SummaryFields inherited from interface org.eclipse.aether.graph.DependencyNodeMANAGED_EXCLUSIONS, MANAGED_OPTIONAL, MANAGED_PROPERTIES, MANAGED_SCOPE, MANAGED_VERSION
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultDependencyNode(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.Creates a mostly shallow clone of the specified node.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaccept(DependencyVisitor visitor) Traverses this node and potentially its children using the specified visitor.Collection<? extends Artifact> Gets the known aliases for this dependency's artifact.Gets the artifact associated with this node.Gets the child nodes of this node.getData()Gets the custom data associated with this dependency node.Gets the dependency associated with this node.intGets a bit field indicating which attributes of this node were subject to dependency management.Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.Gets the remote repositories from which this node's artifact shall be resolved.Gets the request context in which this dependency node was created.Gets the version that was selected for the dependency's target artifact.Gets the version constraint that was parsed from the dependency's version declaration.voidsetAliases(Collection<? extends Artifact> aliases) Sets the known aliases for this dependency's artifact.voidsetArtifact(Artifact artifact) Updates the artifact of the dependency after resolution.voidsetChildren(List<DependencyNode> children) Sets the child nodes of this node.voidAssociates the specified dependency node data with the given key.voidSets the custom data associated with this dependency node.voidsetManagedBits(int managedBits) Sets a bit field indicating which attributes of this node were subject to dependency management.voidsetOptional(Boolean optional) Sets the optional flag of the dependency.voidsetRelocations(List<? extends Artifact> relocations) Sets the sequence of relocations that was followed to resolve this dependency's artifact.voidsetRepositories(List<RemoteRepository> repositories) Sets the remote repositories from which this node's artifact shall be resolved.voidsetRequestContext(String context) Sets the request context in which this dependency node was created.voidSets the scope of the dependency.voidsetVersion(Version version) Sets the version that was selected for the dependency's target artifact.voidsetVersionConstraint(VersionConstraint versionConstraint) Sets the version constraint that was parsed from the dependency's version declaration.toString()
- 
Constructor Details- 
DefaultDependencyNodeCreates a new node with the specified dependency.- Parameters:
- dependency- The dependency associated with this node, may be- nullfor a root node.
 
- 
DefaultDependencyNodeCreates a new root node with the specified artifact as its label. Note that the new node has no dependency, i.e.getDependency()will returnnull. Put differently, the specified artifact will not be subject to dependency collection/resolution.- Parameters:
- artifact- The artifact to use as label for this node, may be- null.
 
- 
DefaultDependencyNodeCreates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and initially no children.- Parameters:
- node- The node to copy, must not be- null.
 
 
- 
- 
Method Details- 
getChildrenDescription copied from interface:DependencyNodeGets the child nodes of this node. To conserve memory, dependency nodes with equal dependencies may share the same child list instance. Hence clients mutating the child list need to be aware that these changes might affect more than this node. Where this is not desired, the child list should be copied before mutation if the client cannot be sure whether it might be shared with other nodes in the graph.- Specified by:
- getChildrenin interface- DependencyNode
- Returns:
- The child nodes of this node, never null.
 
- 
setChildrenDescription copied from interface:DependencyNodeSets the child nodes of this node.- Specified by:
- setChildrenin interface- DependencyNode
- Parameters:
- children- The child nodes, may be- null
 
- 
getDependencyDescription copied from interface:DependencyNodeGets the dependency associated with this node. Note: For dependency graphs that have been constructed without a root dependency, this method will yieldnullwhen invoked on the graph's root node. The root node of such graphs may however still have a label as returned byDependencyNode.getArtifact().- Specified by:
- getDependencyin interface- DependencyNode
- Returns:
- The dependency or nullif none.
 
- 
getArtifactDescription copied from interface:DependencyNodeGets the artifact associated with this node. If this node is associated with a dependency, this is equivalent togetDependency().getArtifact(). Otherwise the artifact merely provides a label for this node in which case the artifact must not be subjected to dependency collection/resolution.- Specified by:
- getArtifactin interface- DependencyNode
- Returns:
- The associated artifact or nullif none.
 
- 
setArtifactDescription copied from interface:DependencyNodeUpdates the artifact of the dependency after resolution. The new artifact must have the same coordinates as the original artifact. This method may only be invoked if this node actually has a dependency, i.e. ifDependencyNode.getDependency()is not null.- Specified by:
- setArtifactin interface- DependencyNode
- Parameters:
- artifact- The artifact satisfying the dependency, must not be- null.
 
- 
getRelocationsDescription copied from interface:DependencyNodeGets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.- Specified by:
- getRelocationsin interface- DependencyNode
- Returns:
- The (read-only) sequence of relocations, never null.
 
- 
setRelocationsSets the sequence of relocations that was followed to resolve this dependency's artifact.- Parameters:
- relocations- The sequence of relocations, may be- null.
 
- 
getAliasesDescription copied from interface:DependencyNodeGets the known aliases for this dependency's artifact. An alias can be used to mark a patched rebuild of some other artifact as such, thereby allowing conflict resolution to consider the patched and the original artifact as a conflict.- Specified by:
- getAliasesin interface- DependencyNode
- Returns:
- The (read-only) set of known aliases, never null.
 
- 
setAliasesSets the known aliases for this dependency's artifact.- Parameters:
- aliases- The known aliases, may be- null.
 
- 
getVersionConstraintDescription copied from interface:DependencyNodeGets the version constraint that was parsed from the dependency's version declaration.- Specified by:
- getVersionConstraintin interface- DependencyNode
- Returns:
- The version constraint for this node or null.
 
- 
setVersionConstraintSets the version constraint that was parsed from the dependency's version declaration.- Parameters:
- versionConstraint- The version constraint for this node, may be- null.
 
- 
getVersionDescription copied from interface:DependencyNodeGets the version that was selected for the dependency's target artifact.- Specified by:
- getVersionin interface- DependencyNode
- Returns:
- The parsed version or null.
 
- 
setVersionSets the version that was selected for the dependency's target artifact.- Parameters:
- version- The parsed version, may be- null.
 
- 
setScopeDescription copied from interface:DependencyNodeSets the scope of the dependency. This method may only be invoked if this node actually has a dependency, i.e. ifDependencyNode.getDependency()is not null.- Specified by:
- setScopein interface- DependencyNode
- Parameters:
- scope- The scope, may be- null.
 
- 
setOptionalDescription copied from interface:DependencyNodeSets the optional flag of the dependency. This method may only be invoked if this node actually has a dependency, i.e. ifDependencyNode.getDependency()is not null.- Specified by:
- setOptionalin interface- DependencyNode
- Parameters:
- optional- The optional flag, may be- null.
 
- 
getManagedBitsDescription copied from interface:DependencyNodeGets a bit field indicating which attributes of this node were subject to dependency management.- Specified by:
- getManagedBitsin interface- DependencyNode
- Returns:
- A bit field containing any of the bits DependencyNode.MANAGED_VERSION,DependencyNode.MANAGED_SCOPE,DependencyNode.MANAGED_OPTIONAL,DependencyNode.MANAGED_PROPERTIESandDependencyNode.MANAGED_EXCLUSIONSif the corresponding attribute was set via dependency management.
 
- 
setManagedBitsSets a bit field indicating which attributes of this node were subject to dependency management.- Parameters:
- managedBits- The bit field indicating the managed attributes or- 0if dependency management wasn't applied.
 
- 
getRepositoriesDescription copied from interface:DependencyNodeGets the remote repositories from which this node's artifact shall be resolved.- Specified by:
- getRepositoriesin interface- DependencyNode
- Returns:
- The (read-only) list of remote repositories to use for artifact resolution, never null.
 
- 
setRepositoriesSets 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.
 
- 
getRequestContextDescription copied from interface:DependencyNodeGets the request context in which this dependency node was created.- Specified by:
- getRequestContextin interface- DependencyNode
- Returns:
- The request context, never null.
 
- 
setRequestContextDescription copied from interface:DependencyNodeSets the request context in which this dependency node was created.- Specified by:
- setRequestContextin interface- DependencyNode
- Parameters:
- context- The context, may be- null.
 
- 
getDataDescription copied from interface:DependencyNodeGets the custom data associated with this dependency node. Clients of the repository system can use this data to annotate dependency nodes with domain-specific information. Note that the returned map is read-only andDependencyNode.setData(Object, Object)needs to be used to update the custom data.- Specified by:
- getDatain interface- DependencyNode
- Returns:
- The (read-only) key-value mappings, never null.
 
- 
setDataDescription copied from interface:DependencyNodeSets the custom data associated with this dependency node.- Specified by:
- setDatain interface- DependencyNode
- Parameters:
- data- The new custom data, may be- null.
 
- 
setDataDescription copied from interface:DependencyNodeAssociates the specified dependency node data with the given key. Note: This method must not be called whileDependencyNode.getData()is being iterated.- Specified by:
- setDatain interface- DependencyNode
- Parameters:
- key- The key under which to store the data, must not be- null.
- value- The data to associate with the key, may be- nullto remove the mapping.
 
- 
acceptDescription copied from interface:DependencyNodeTraverses this node and potentially its children using the specified visitor.- Specified by:
- acceptin interface- DependencyNode
- Parameters:
- visitor- The visitor to call back, must not be- null.
- Returns:
- trueto visit siblings nodes of this node as well,- falseto skip siblings.
 
- 
toString
 
-