Class NodeListGenerator

java.lang.Object
org.eclipse.aether.util.graph.visitor.NodeListGenerator
All Implemented Interfaces:
Consumer<org.eclipse.aether.graph.DependencyNode>

public final class NodeListGenerator extends Object implements Consumer<org.eclipse.aether.graph.DependencyNode>
Node list generator usable with different traversing strategies. It is wrapped List<DependencyNode> but offers several transformations, that are handy.
Since:
2.0.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accept(org.eclipse.aether.graph.DependencyNode dependencyNode)
     
    List<org.eclipse.aether.artifact.Artifact>
    getArtifacts(boolean includeUnresolved)
    Gets the artifacts associated with the list of dependency nodes generated during the graph traversal.
    Gets a class path by concatenating the artifact files of the visited dependency nodes.
    List<org.eclipse.aether.graph.Dependency>
    getDependencies(boolean includeUnresolved)
    Gets the dependencies seen during the graph traversal.
    Gets the files of resolved artifacts seen during the graph traversal.
    List<org.eclipse.aether.graph.DependencyNode>
    Gets the list of dependency nodes that was generated during the graph traversal.
    List<org.eclipse.aether.graph.DependencyNode>
    Gets the list of dependency nodes that was generated during the graph traversal and have non-null DependencyNode.getDependency().

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Constructor Details

  • Method Details

    • accept

      public void accept(org.eclipse.aether.graph.DependencyNode dependencyNode)
      Specified by:
      accept in interface Consumer<org.eclipse.aether.graph.DependencyNode>
    • getNodes

      public List<org.eclipse.aether.graph.DependencyNode> getNodes()
      Gets the list of dependency nodes that was generated during the graph traversal.
      Returns:
      The list of dependency nodes, never null.
    • getNodesWithDependencies

      public List<org.eclipse.aether.graph.DependencyNode> getNodesWithDependencies()
      Gets the list of dependency nodes that was generated during the graph traversal and have non-null DependencyNode.getDependency().
      Returns:
      The list of dependency nodes having dependency, never null.
    • getDependencies

      public List<org.eclipse.aether.graph.Dependency> getDependencies(boolean includeUnresolved)
      Gets the dependencies seen during the graph traversal.
      Parameters:
      includeUnresolved - Whether unresolved dependencies shall be included in the result or not.
      Returns:
      The list of dependencies, never null.
    • getArtifacts

      public List<org.eclipse.aether.artifact.Artifact> getArtifacts(boolean includeUnresolved)
      Gets the artifacts associated with the list of dependency nodes generated during the graph traversal.
      Parameters:
      includeUnresolved - Whether unresolved artifacts shall be included in the result or not.
      Returns:
      The list of artifacts, never null.
    • getFiles

      public List<File> getFiles()
      Gets the files of resolved artifacts seen during the graph traversal.
      Returns:
      The list of artifact files, never null.
    • getClassPath

      public String getClassPath()
      Gets a class path by concatenating the artifact files of the visited dependency nodes. Nodes with unresolved artifacts are automatically skipped.
      Returns:
      The class path, using the platform-specific path separator, never null.