Package com.google.inject.grapher
Class AbstractInjectorGrapher
- java.lang.Object
-
- 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.- Since:
- 4.0
- Author:
- bojand@google.com (Bojan Djordjevic)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractInjectorGrapher.GrapherParameters
Parameters used to override default settings of the grapher.
-
Constructor Summary
Constructors Constructor Description AbstractInjectorGrapher()
AbstractInjectorGrapher(AbstractInjectorGrapher.GrapherParameters options)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
graph(com.google.inject.Injector injector)
Graphs the guice dependency graph for the given injector using default starting keys.void
graph(com.google.inject.Injector injector, Set<com.google.inject.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.
-
-
-
Constructor Detail
-
AbstractInjectorGrapher
public AbstractInjectorGrapher()
-
AbstractInjectorGrapher
public AbstractInjectorGrapher(AbstractInjectorGrapher.GrapherParameters options)
-
-
Method Detail
-
graph
public final void graph(com.google.inject.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 interfaceInjectorGrapher
- Throws:
IOException
-
graph
public final void graph(com.google.inject.Injector injector, Set<com.google.inject.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 interfaceInjectorGrapher
- 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
-
-