Class DefaultDependencyNode

  • All Implemented Interfaces:
    DependencyNode

    public class DefaultDependencyNode
    extends java.lang.Object
    implements DependencyNode
    Default implementation of a DependencyNode.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultDependencyNode​(DependencyNode parent, org.apache.maven.artifact.Artifact artifact, java.lang.String premanagedVersion, java.lang.String premanagedScope, java.lang.String versionConstraint)
      Constructs the DefaultDependencyNode.
    • Constructor Detail

      • DefaultDependencyNode

        public DefaultDependencyNode​(DependencyNode parent,
                                     org.apache.maven.artifact.Artifact artifact,
                                     java.lang.String premanagedVersion,
                                     java.lang.String premanagedScope,
                                     java.lang.String versionConstraint)
        Constructs the DefaultDependencyNode.
        Parameters:
        parent - Parent node.
        artifact - Artifact associated with this dependency.
        premanagedVersion -
        premanagedScope -
        versionConstraint -
    • Method Detail

      • accept

        public boolean accept​(DependencyNodeVisitor visitor)
        Applies the specified dependency node visitor to this dependency node and its children.
        Specified by:
        accept in interface DependencyNode
        Parameters:
        visitor - the dependency node visitor to use
        Returns:
        the visitor result of ending the visit to this node
        Since:
        1.1
      • getArtifact

        public org.apache.maven.artifact.Artifact getArtifact()
        Specified by:
        getArtifact in interface DependencyNode
        Returns:
        Artifact for this DependencyNode.
      • setChildren

        public void setChildren​(java.util.List<DependencyNode> children)
        Parameters:
        children - List of DependencyNode to set as child nodes.
      • getPremanagedVersion

        public java.lang.String 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 interface DependencyNode
        Returns:
        The dependency version before dependency management or null if the version was not managed.
      • getPremanagedScope

        public java.lang.String getPremanagedScope()
        Description copied from interface: DependencyNode
        Gets the scope for the dependency before dependency management was applied (if any).
        Specified by:
        getPremanagedScope in interface DependencyNode
        Returns:
        The dependency scope before dependency management or null if the scope was not managed.
      • getVersionConstraint

        public java.lang.String 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 interface DependencyNode
        Returns:
        The constraint on the dependency.
      • toNodeString

        public java.lang.String toNodeString()
        Description copied from interface: DependencyNode
        Returns a string representation of this dependency node.
        Specified by:
        toNodeString in interface DependencyNode
        Returns:
        Stringified representation of this DependencyNode.