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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractInjectorGrapher.GrapherParametersParameters 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 voidgraph(Injector injector)Graphs the guice dependency graph for the given injector using default starting keys.voidgraph(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 voidnewBindingEdge(BindingEdge edge)Adds a new binding edge to the graph.protected abstract voidnewDependencyEdge(DependencyEdge edge)Adds a new dependency edge to the graph.protected abstract voidnewImplementationNode(ImplementationNode node)Adds a new implementation node to the graph.protected abstract voidnewInstanceNode(InstanceNode node)Adds a new instance node to the graph.protected abstract voidnewInterfaceNode(InterfaceNode node)Adds a new interface node to the graph.protected abstract voidpostProcess()Performs any post processing required after all nodes and edges have been added.protected abstract voidreset()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(Injector injector) throws IOException
Description copied from interface:InjectorGrapherGraphs the guice dependency graph for the given injector using default starting keys.- Specified by:
graphin interfaceInjectorGrapher- Throws:
IOException
-
graph
public final void graph(Injector injector, Set<Key<?>> root) throws IOException
Description copied from interface:InjectorGrapherGraphs the guice dependency graph for the given injector using the given starting keys and their transitive dependencies.- Specified by:
graphin interfaceInjectorGrapher- Throws:
IOException
-
reset
protected abstract void reset() throws IOExceptionResets 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 IOExceptionPerforms any post processing required after all nodes and edges have been added.- Throws:
IOException
-
-