public abstract class AbstractInjectorGrapher extends java.lang.Object implements InjectorGrapher
Modifier and Type | Class and Description |
---|---|
static class |
AbstractInjectorGrapher.GrapherParameters
Parameters used to override default settings of the grapher.
|
Modifier and Type | Field and Description |
---|---|
private AliasCreator |
aliasCreator |
private EdgeCreator |
edgeCreator |
private NodeCreator |
nodeCreator |
private RootKeySetCreator |
rootKeySetCreator |
Constructor and Description |
---|
AbstractInjectorGrapher() |
AbstractInjectorGrapher(AbstractInjectorGrapher.GrapherParameters options) |
Modifier and Type | Method and Description |
---|---|
private void |
createEdges(java.lang.Iterable<Edge> edges,
java.util.Map<NodeId,NodeId> aliases) |
private void |
createNodes(java.lang.Iterable<Node> nodes,
java.util.Map<NodeId,NodeId> aliases) |
private java.lang.Iterable<Binding<?>> |
getBindings(Injector injector,
java.util.Set<Key<?>> root)
Returns the bindings for the root keys and their transitive dependencies.
|
void |
graph(Injector injector)
Graphs the guice dependency graph for the given injector using default starting keys.
|
void |
graph(Injector injector,
java.util.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.
|
private NodeId |
resolveAlias(java.util.Map<NodeId,NodeId> aliases,
NodeId nodeId) |
private java.util.Map<NodeId,NodeId> |
resolveAliases(java.lang.Iterable<Alias> aliases)
Transitively resolves aliases.
|
private final RootKeySetCreator rootKeySetCreator
private final AliasCreator aliasCreator
private final NodeCreator nodeCreator
private final EdgeCreator edgeCreator
public AbstractInjectorGrapher()
public AbstractInjectorGrapher(AbstractInjectorGrapher.GrapherParameters options)
public final void graph(Injector injector) throws java.io.IOException
InjectorGrapher
graph
in interface InjectorGrapher
java.io.IOException
public final void graph(Injector injector, java.util.Set<Key<?>> root) throws java.io.IOException
InjectorGrapher
graph
in interface InjectorGrapher
java.io.IOException
protected abstract void reset() throws java.io.IOException
java.io.IOException
protected abstract void newInterfaceNode(InterfaceNode node) throws java.io.IOException
java.io.IOException
protected abstract void newImplementationNode(ImplementationNode node) throws java.io.IOException
java.io.IOException
protected abstract void newInstanceNode(InstanceNode node) throws java.io.IOException
java.io.IOException
protected abstract void newDependencyEdge(DependencyEdge edge) throws java.io.IOException
java.io.IOException
protected abstract void newBindingEdge(BindingEdge edge) throws java.io.IOException
java.io.IOException
protected abstract void postProcess() throws java.io.IOException
java.io.IOException
private void createNodes(java.lang.Iterable<Node> nodes, java.util.Map<NodeId,NodeId> aliases) throws java.io.IOException
java.io.IOException
private void createEdges(java.lang.Iterable<Edge> edges, java.util.Map<NodeId,NodeId> aliases) throws java.io.IOException
java.io.IOException
private java.util.Map<NodeId,NodeId> resolveAliases(java.lang.Iterable<Alias> aliases)