Class DependencyGraphDumper

java.lang.Object
org.eclipse.aether.util.graph.visitor.DependencyGraphDumper
All Implemented Interfaces:
org.eclipse.aether.graph.DependencyVisitor

public class DependencyGraphDumper extends Object implements org.eclipse.aether.graph.DependencyVisitor
A dependency visitor that dumps the graph to any Consumer<String>. Meant for diagnostic and testing, as it may output the graph to standard output, error or even some logging interface.
Since:
1.9.8
  • Constructor Details

    • DependencyGraphDumper

      Creates instance with given consumer.
      Parameters:
      consumer - The string consumer, must not be null.
    • DependencyGraphDumper

      public DependencyGraphDumper(Consumer<String> consumer, Collection<Function<org.eclipse.aether.graph.DependencyNode,String>> decorators)
      Creates instance with given consumer and decorators.
      Parameters:
      consumer - The string consumer, must not be null.
      decorators - The decorators to apply, must not be null.
      Since:
      2.0.0
  • Method Details

    • effectiveDependency

      public static Function<org.eclipse.aether.graph.DependencyNode,String> effectiveDependency()
      Decorator of "effective dependency": shows effective scope and optionality.
    • premanagedVersion

      public static Function<org.eclipse.aether.graph.DependencyNode,String> premanagedVersion()
      Decorator of "managed version": explains on nodes what was managed.
    • premanagedScope

      public static Function<org.eclipse.aether.graph.DependencyNode,String> premanagedScope()
      Decorator of "managed scope": explains on nodes what was managed.
    • premanagedOptional

      public static Function<org.eclipse.aether.graph.DependencyNode,String> premanagedOptional()
      Decorator of "managed optionality": explains on nodes what was managed.
    • premanagedExclusions

      public static Function<org.eclipse.aether.graph.DependencyNode,String> premanagedExclusions()
      Decorator of "managed exclusions": explains on nodes what was managed.
    • premanagedProperties

      public static Function<org.eclipse.aether.graph.DependencyNode,String> premanagedProperties()
      Decorator of "managed properties": explains on nodes what was managed.
    • rangeMember

      public static Function<org.eclipse.aether.graph.DependencyNode,String> rangeMember()
      Decorator of "range member": explains on nodes what range it participates in.
    • winnerNode

      public static Function<org.eclipse.aether.graph.DependencyNode,String> winnerNode()
      Decorator of "winner node": explains on losers why lost.
    • artifactProperties

      public static Function<org.eclipse.aether.graph.DependencyNode,String> artifactProperties(Collection<String> properties)
      Decorator of "artifact properties": prints out asked properties, if present.
    • defaultsWith

      public static List<Function<org.eclipse.aether.graph.DependencyNode,String>> defaultsWith(Collection<Function<org.eclipse.aether.graph.DependencyNode,String>> extras)
      Extends DEFAULT_DECORATORS decorators with passed in ones.
      Since:
      2.0.0
    • visitEnter

      public boolean visitEnter(org.eclipse.aether.graph.DependencyNode node)
      Specified by:
      visitEnter in interface org.eclipse.aether.graph.DependencyVisitor
    • visitLeave

      public boolean visitLeave(org.eclipse.aether.graph.DependencyNode node)
      Specified by:
      visitLeave in interface org.eclipse.aether.graph.DependencyVisitor
    • formatLine

      protected String formatLine(Deque<org.eclipse.aether.graph.DependencyNode> nodes)
    • formatIndentation

      protected String formatIndentation(Deque<org.eclipse.aether.graph.DependencyNode> nodes)
    • formatNode

      protected String formatNode(Deque<org.eclipse.aether.graph.DependencyNode> nodes)