Package com.google.inject.grapher
Class AbstractInjectorGrapher
java.lang.Object
com.google.inject.grapher.AbstractInjectorGrapher
- All Implemented Interfaces:
InjectorGrapher
- Direct Known Subclasses:
GraphvizGrapher
Abstract injector grapher that builds the dependency graph but doesn't render it.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classParameters used to override default settings of the grapher. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AliasCreatorprivate final EdgeCreatorprivate final NodeCreatorprivate final RootKeySetCreator -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate voidgetBindings(Injector injector, Set<Key<?>> root) Returns the bindings for the root keys and their transitive dependencies.final voidGraphs the guice dependency graph for the given injector using default starting keys.final voidGraphs 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 voidAdds a new dependency edge to the graph.protected abstract voidAdds a new implementation node to the graph.protected abstract voidnewInstanceNode(InstanceNode node) Adds a new instance node to the graph.protected abstract voidAdds a new interface node to the graph.protected abstract voidPerforms 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.private NodeIdresolveAlias(Map<NodeId, NodeId> aliases, NodeId nodeId) resolveAliases(Iterable<Alias> aliases) Transitively resolves aliases.
-
Field Details
-
rootKeySetCreator
-
aliasCreator
-
nodeCreator
-
edgeCreator
-
-
Constructor Details
-
AbstractInjectorGrapher
public AbstractInjectorGrapher() -
AbstractInjectorGrapher
-
-
Method Details
-
graph
Description copied from interface:InjectorGrapherGraphs the guice dependency graph for the given injector using default starting keys.- Specified by:
graphin interfaceInjectorGrapher- Throws:
IOException
-
graph
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
Resets the state of the grapher before rendering a new graph.- Throws:
IOException
-
newInterfaceNode
Adds a new interface node to the graph.- Throws:
IOException
-
newImplementationNode
Adds a new implementation node to the graph.- Throws:
IOException
-
newInstanceNode
Adds a new instance node to the graph.- Throws:
IOException
-
newDependencyEdge
Adds a new dependency edge to the graph.- Throws:
IOException
-
newBindingEdge
Adds a new binding edge to the graph.- Throws:
IOException
-
postProcess
Performs any post processing required after all nodes and edges have been added.- Throws:
IOException
-
createNodes
- Throws:
IOException
-
createEdges
- Throws:
IOException
-
resolveAlias
-
resolveAliases
Transitively resolves aliases. Given aliases (X to Y) and (Y to Z), it will return mappings (X to Z) and (Y to Z). -
getBindings
Returns the bindings for the root keys and their transitive dependencies.
-