com.google.inject.grapher
Class AbstractInjectorGrapher

java.lang.Object
  extended by com.google.inject.grapher.AbstractInjectorGrapher
All Implemented Interfaces:
InjectorGrapher
Direct Known Subclasses:
GraphvizGrapher

public abstract class AbstractInjectorGrapher
extends Object
implements InjectorGrapher

Abstract injector grapher that builds the dependency graph but doesn't render it.

Author:
bojand@google.com (Bojan Djordjevic)

Nested Class Summary
static class AbstractInjectorGrapher.GrapherParameters
          Parameters used to override default settings of the grapher.
 
Constructor Summary
AbstractInjectorGrapher()
           
AbstractInjectorGrapher(AbstractInjectorGrapher.GrapherParameters options)
           
 
Method Summary
 void graph(Injector injector)
          Graphs the guice dependency graph for the given injector using default starting keys.
 void graph(Injector injector, Set<Key<?>> root)
          Graphs the guice dependency graph for the given injector using the given starting keys and their transitive dependencies.
protected abstract  void newBindingEdge(BindingEdge edge)
          Adds a new binding edge to the graph.
protected abstract  void newDependencyEdge(DependencyEdge edge)
          Adds a new dependency edge to the graph.
protected abstract  void newImplementationNode(ImplementationNode node)
          Adds a new implementation node to the graph.
protected abstract  void newInstanceNode(InstanceNode node)
          Adds a new instance node to the graph.
protected abstract  void newInterfaceNode(InterfaceNode node)
          Adds a new interface node to the graph.
protected abstract  void postProcess()
          Performs any post processing required after all nodes and edges have been added.
protected abstract  void reset()
          Resets the state of the grapher before rendering a new graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractInjectorGrapher

public AbstractInjectorGrapher()

AbstractInjectorGrapher

public AbstractInjectorGrapher(AbstractInjectorGrapher.GrapherParameters options)
Method Detail

graph

public final void graph(Injector injector)
                 throws 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:
IOException

graph

public final void graph(Injector injector,
                        Set<Key<?>> root)
                 throws 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:
IOException

reset

protected abstract void reset()
                       throws IOException
Resets the state of the grapher before rendering a new graph.

Throws:
IOException

newInterfaceNode

protected abstract void newInterfaceNode(InterfaceNode node)
                                  throws IOException
Adds a new interface node to the graph.

Throws:
IOException

newImplementationNode

protected abstract void newImplementationNode(ImplementationNode node)
                                       throws IOException
Adds a new implementation node to the graph.

Throws:
IOException

newInstanceNode

protected abstract void newInstanceNode(InstanceNode node)
                                 throws IOException
Adds a new instance node to the graph.

Throws:
IOException

newDependencyEdge

protected abstract void newDependencyEdge(DependencyEdge edge)
                                   throws IOException
Adds a new dependency edge to the graph.

Throws:
IOException

newBindingEdge

protected abstract void newBindingEdge(BindingEdge edge)
                                throws IOException
Adds a new binding edge to the graph.

Throws:
IOException

postProcess

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

Throws:
IOException


Copyright © 2006-2014 Google, Inc.. All Rights Reserved.