Interface DependencyNode
-
- All Known Implementing Classes:
DefaultDependencyNode
public interface DependencyNode
Represents an artifact node within a Maven project's dependency graph. Notice there is no support for omitted nodes at the moment, only dependencies kept in the resolved dependency list are available.- Since:
- 2.0
- Author:
- Hervé Boutemy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
accept(DependencyNodeVisitor visitor)
Applies the specified dependency node visitor to this dependency node and its children.org.apache.maven.artifact.Artifact
getArtifact()
List<DependencyNode>
getChildren()
List<org.apache.maven.model.Exclusion>
getExclusions()
Boolean
getOptional()
DependencyNode
getParent()
Gets the parent dependency node of this dependency node.String
getPremanagedScope()
Gets the scope for the dependency before dependency management was applied (if any).String
getPremanagedVersion()
Gets the version or version range for the dependency before dependency management was applied (if any).String
getVersionConstraint()
A constraint on versions for a dependency.String
toNodeString()
Returns a string representation of this dependency node.
-
-
-
Method Detail
-
getArtifact
org.apache.maven.artifact.Artifact getArtifact()
- Returns:
- Artifact for this DependencyNode.
-
getChildren
List<DependencyNode> getChildren()
- Returns:
- children of this DependencyNode.
-
accept
boolean accept(DependencyNodeVisitor visitor)
Applies the specified dependency node visitor to this dependency node and its children.- Parameters:
visitor
- the dependency node visitor to use- Returns:
- the visitor result of ending the visit to this node
- Since:
- 1.1
-
getParent
DependencyNode getParent()
Gets the parent dependency node of this dependency node.- Returns:
- the parent dependency node
-
getPremanagedVersion
String getPremanagedVersion()
Gets the version or version range for the dependency before dependency management was applied (if any).- Returns:
- The dependency version before dependency management or
null
if the version was not managed.
-
getPremanagedScope
String getPremanagedScope()
Gets the scope for the dependency before dependency management was applied (if any).- Returns:
- The dependency scope before dependency management or
null
if the scope was not managed.
-
getVersionConstraint
String getVersionConstraint()
A constraint on versions for a dependency. A constraint can either consist of one or more version ranges or a single version.- Returns:
- The constraint on the dependency.
-
toNodeString
String toNodeString()
Returns a string representation of this dependency node.- Returns:
- the string representation
-
getOptional
Boolean getOptional()
- Returns:
- true for an optional dependency.
-
getExclusions
List<org.apache.maven.model.Exclusion> getExclusions()
- Returns:
- the exclusions of the dependency
-
-