Interface Node

All Known Implementing Classes:
AbstractNode, DefaultNode

@Experimental @Immutable @Provider public interface Node
Represents a dependency node within a Maven project's dependency collector.
Since:
4.0.0
See Also:
  • Method Details

    • getArtifact

      @Nullable Artifact getArtifact()
      Returns:
      artifact for this node
    • getDependency

      @Nullable Dependency getDependency()
      Returns:
      dependency for this node
    • getChildren

      @Nonnull List<Node> getChildren()
      Gets the child nodes of this node.
      Returns:
      the child nodes of this node, never null
    • getRemoteRepositories

      @Nonnull List<RemoteRepository> getRemoteRepositories()
      Returns:
      repositories of this node
    • getRepository

      The repository where this artifact has been downloaded from.
    • accept

      boolean accept(@Nonnull NodeVisitor visitor)
      Traverses this node and potentially its children using the specified visitor.
      Parameters:
      visitor - the visitor to call back, must not be null
      Returns:
      true to visit siblings nodes of this node as well, false to skip siblings
    • filter

      @Nonnull Node filter(@Nonnull Predicate<Node> filter)
      Returns a new tree starting at this node, filtering the children. Note that this node will not be filtered and only the children and its descendant will be checked.
      Parameters:
      filter - the filter to apply
      Returns:
      a new filtered graph
    • asString

      @Nonnull String asString()
      Returns a detailed string representation of this dependency node.

      When verbose mode is disabled, returns the basic string representation in the format: groupId:artifactId:version[:scope]

      When verbose mode is enabled, additional details are included with the following format:

      • For included dependencies: groupId:artifactId:version[:scope] (details)
      • For omitted dependencies: (groupId:artifactId:version[:scope] - details)
      Where details may include:
      • Version management information (if the version was managed from a different version)
      • Scope management information (if the scope was managed from a different scope)
      • Scope updates (if the scope was changed during resolution)
      • Conflict resolution information (if the dependency was omitted due to conflicts or duplicates)
      Returns:
      a string representation of this dependency node with optional detailed information
    • stream

      @Nonnull default Stream<Node> stream()
      Obtain a Stream containing this node and all its descendants.
      Returns:
      a stream containing this node and its descendants