Class AbstractInjectorGrapher

  • All Implemented Interfaces:
    InjectorGrapher
    Direct Known Subclasses:
    GraphvizGrapher

    public abstract class AbstractInjectorGrapher
    extends java.lang.Object
    implements InjectorGrapher
    Abstract injector grapher that builds the dependency graph but doesn't render it.
    Since:
    4.0
    • Method Detail

      • graph

        public final void graph​(Injector injector)
                         throws java.io.IOException
        Description copied from interface: InjectorGrapher
        Graphs the guice dependency graph for the given injector using default starting keys.
        Specified by:
        graph in interface InjectorGrapher
        Throws:
        java.io.IOException
      • graph

        public final void graph​(Injector injector,
                                java.util.Set<Key<?>> root)
                         throws java.io.IOException
        Description copied from interface: InjectorGrapher
        Graphs the guice dependency graph for the given injector using the given starting keys and their transitive dependencies.
        Specified by:
        graph in interface InjectorGrapher
        Throws:
        java.io.IOException
      • reset

        protected abstract void reset()
                               throws java.io.IOException
        Resets the state of the grapher before rendering a new graph.
        Throws:
        java.io.IOException
      • newInterfaceNode

        protected abstract void newInterfaceNode​(InterfaceNode node)
                                          throws java.io.IOException
        Adds a new interface node to the graph.
        Throws:
        java.io.IOException
      • newImplementationNode

        protected abstract void newImplementationNode​(ImplementationNode node)
                                               throws java.io.IOException
        Adds a new implementation node to the graph.
        Throws:
        java.io.IOException
      • newInstanceNode

        protected abstract void newInstanceNode​(InstanceNode node)
                                         throws java.io.IOException
        Adds a new instance node to the graph.
        Throws:
        java.io.IOException
      • newDependencyEdge

        protected abstract void newDependencyEdge​(DependencyEdge edge)
                                           throws java.io.IOException
        Adds a new dependency edge to the graph.
        Throws:
        java.io.IOException
      • newBindingEdge

        protected abstract void newBindingEdge​(BindingEdge edge)
                                        throws java.io.IOException
        Adds a new binding edge to the graph.
        Throws:
        java.io.IOException
      • postProcess

        protected abstract void postProcess()
                                     throws java.io.IOException
        Performs any post processing required after all nodes and edges have been added.
        Throws:
        java.io.IOException