Package org.eclipse.aether.graph
Interface DependencyNode
- All Known Implementing Classes:
- DefaultDependencyNode
public interface DependencyNode
A node within a dependency graph. To conserve memory, dependency graphs may reuse a given node instance multiple
 times to represent reoccurring dependencies. As such clients traversing a dependency graph should be prepared to
 discover multiple paths leading to the same node instance unless the input graph is known to be a duplicate-free
 tree. Note: Unless otherwise noted, implementation classes are not thread-safe and dependency nodes should
 not be mutated by concurrent threads.
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intA bit flag indicating the exclusions were subject to dependency managementstatic final intA bit flag indicating the optional flag was subject to dependency managementstatic final intA bit flag indicating the artifact properties were subject to dependency managementstatic final intA bit flag indicating the dependency scope was subject to dependency managementstatic final intA bit flag indicating the dependency version was subject to dependency management
- 
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.Map<?, ?> 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.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.voidsetOptional(Boolean optional) Sets the optional flag of the dependency.voidsetRequestContext(String context) Sets the request context in which this dependency node was created.voidSets the scope of the dependency.
- 
Field Details- 
MANAGED_VERSIONA bit flag indicating the dependency version was subject to dependency management- See Also:
 
- 
MANAGED_SCOPEA bit flag indicating the dependency scope was subject to dependency management- See Also:
 
- 
MANAGED_OPTIONALA bit flag indicating the optional flag was subject to dependency management- See Also:
 
- 
MANAGED_PROPERTIESA bit flag indicating the artifact properties were subject to dependency management- See Also:
 
- 
MANAGED_EXCLUSIONSA bit flag indicating the exclusions were subject to dependency management- See Also:
 
 
- 
- 
Method Details- 
getChildrenGets 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.- Returns:
- The child nodes of this node, never null.
 
- 
setChildrenSets the child nodes of this node.- Parameters:
- children- The child nodes, may be- null
 
- 
getDependencyGets 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 bygetArtifact().- Returns:
- The dependency or nullif none.
 
- 
getArtifactGets 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.- Returns:
- The associated artifact or nullif none.
 
- 
setArtifactUpdates 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. ifgetDependency()is not null.- Parameters:
- artifact- The artifact satisfying the dependency, must not be- null.
 
- 
getRelocationsList<? extends Artifact> getRelocations()Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.- Returns:
- The (read-only) sequence of relocations, never null.
 
- 
getAliasesCollection<? extends Artifact> getAliases()Gets 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.- Returns:
- The (read-only) set of known aliases, never null.
 
- 
getVersionConstraintGets the version constraint that was parsed from the dependency's version declaration.- Returns:
- The version constraint for this node or null.
 
- 
getVersionGets the version that was selected for the dependency's target artifact.- Returns:
- The parsed version or null.
 
- 
setScopeSets the scope of the dependency. This method may only be invoked if this node actually has a dependency, i.e. ifgetDependency()is not null.- Parameters:
- scope- The scope, may be- null.
 
- 
setOptionalSets the optional flag of the dependency. This method may only be invoked if this node actually has a dependency, i.e. ifgetDependency()is not null.- Parameters:
- optional- The optional flag, may be- null.
 
- 
getManagedBitsint getManagedBits()Gets a bit field indicating which attributes of this node were subject to dependency management.- Returns:
- A bit field containing any of the bits MANAGED_VERSION,MANAGED_SCOPE,MANAGED_OPTIONAL,MANAGED_PROPERTIESandMANAGED_EXCLUSIONSif the corresponding attribute was set via dependency management.
 
- 
getRepositoriesGets the remote repositories from which this node's artifact shall be resolved.- Returns:
- The (read-only) list of remote repositories to use for artifact resolution, never null.
 
- 
getRequestContextGets the request context in which this dependency node was created.- Returns:
- The request context, never null.
 
- 
setRequestContextSets the request context in which this dependency node was created.- Parameters:
- context- The context, may be- null.
 
- 
getDataGets 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 andsetData(Object, Object)needs to be used to update the custom data.- Returns:
- The (read-only) key-value mappings, never null.
 
- 
setDataSets the custom data associated with this dependency node.- Parameters:
- data- The new custom data, may be- null.
 
- 
setDataAssociates the specified dependency node data with the given key. Note: This method must not be called whilegetData()is being iterated.- 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.
 
- 
acceptTraverses this node and potentially its children using the specified visitor.- Parameters:
- visitor- The visitor to call back, must not be- null.
- Returns:
- trueto visit siblings nodes of this node as well,- falseto skip siblings.
 
 
-