Class DefaultDependencyNode
java.lang.Object
org.apache.maven.shared.dependency.graph.internal.DefaultDependencyNode
- All Implemented Interfaces:
DependencyNode
Default implementation of a DependencyNode.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Utility class to concatenate a number of parameters with separator tokens. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.maven.artifact.Artifact
private List<DependencyNode>
private Boolean
private final DependencyNode
private final String
private final String
private final String
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDependencyNode
(DependencyNode parent, org.apache.maven.artifact.Artifact artifact, String premanagedVersion, String premanagedScope, String versionConstraint) Constructs the DefaultDependencyNode.DefaultDependencyNode
(DependencyNode parent, org.apache.maven.artifact.Artifact artifact, String premanagedVersion, String premanagedScope, String versionConstraint, Boolean optional) -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept
(DependencyNodeVisitor visitor) Applies the specified dependency node visitor to this dependency node and its children.org.apache.maven.artifact.Artifact
Gets the parent dependency node of this dependency node.Gets the scope for the dependency before dependency management was applied (if any).Gets the version or version range for the dependency before dependency management was applied (if any).A constraint on versions for a dependency.void
setChildren
(List<DependencyNode> children) Returns a string representation of this dependency node.
-
Field Details
-
artifact
private final org.apache.maven.artifact.Artifact artifact -
parent
-
premanagedVersion
-
premanagedScope
-
versionConstraint
-
children
-
optional
-
-
Constructor Details
-
Method Details
-
getArtifact
public org.apache.maven.artifact.Artifact getArtifact()- Specified by:
getArtifact
in interfaceDependencyNode
- Returns:
- Artifact for this DependencyNode.
-
setChildren
- Parameters:
children
- List of DependencyNode to set as child nodes.
-
getChildren
- Specified by:
getChildren
in interfaceDependencyNode
- Returns:
- List of child nodes for this DependencyNode.
-
getParent
Description copied from interface:DependencyNode
Gets the parent dependency node of this dependency node.- Specified by:
getParent
in interfaceDependencyNode
- Returns:
- Parent of this DependencyNode.
-
getPremanagedVersion
Description copied from interface:DependencyNode
Gets the version or version range for the dependency before dependency management was applied (if any).- Specified by:
getPremanagedVersion
in interfaceDependencyNode
- Returns:
- The dependency version before dependency management or
null
if the version was not managed.
-
getPremanagedScope
Description copied from interface:DependencyNode
Gets the scope for the dependency before dependency management was applied (if any).- Specified by:
getPremanagedScope
in interfaceDependencyNode
- Returns:
- The dependency scope before dependency management or
null
if the scope was not managed.
-
getVersionConstraint
Description copied from interface:DependencyNode
A constraint on versions for a dependency. A constraint can either consist of one or more version ranges or a single version.- Specified by:
getVersionConstraint
in interfaceDependencyNode
- Returns:
- The constraint on the dependency.
-
getOptional
- Specified by:
getOptional
in interfaceDependencyNode
- Returns:
- true for an optional dependency.
-
toNodeString
Description copied from interface:DependencyNode
Returns a string representation of this dependency node.- Specified by:
toNodeString
in interfaceDependencyNode
- Returns:
- Stringified representation of this DependencyNode.