Class GraphvizGrapher
java.lang.Object
com.google.inject.grapher.AbstractInjectorGrapher
com.google.inject.grapher.graphviz.GraphvizGrapher
- All Implemented Interfaces:
InjectorGrapher
InjectorGrapher
implementation that writes out a Graphviz DOT
file of the graph. Dependencies are bound in GraphvizModule
.
Specify the PrintWriter
to output to with setOut(PrintWriter)
.
- Since:
- 4.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.inject.grapher.AbstractInjectorGrapher
AbstractInjectorGrapher.GrapherParameters
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<GraphvizEdge> private final NameFactory
private final Map
<NodeId, GraphvizNode> private PrintWriter
private final PortIdFactory
private String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addNode
(GraphvizNode node) protected void
finish()
protected String
getArrowString
(List<ArrowType> arrows) private String
getAttrString
(Map<String, String> attrs) protected String
getEdgeEndPoint
(String nodeId, String portId, CompassPoint compassPoint) protected String
getNodeLabel
(GraphvizNode node) Creates the "label" for a node.protected String
htmlEscape
(String str) htmlEscape
(List<String> elements) protected void
newBindingEdge
(BindingEdge edge) Adds a new binding edge to the graph.protected void
Adds a new dependency edge to the graph.protected void
Adds a new implementation node to the graph.protected void
newInstanceNode
(InstanceNode node) Adds a new instance node to the graph.protected void
Adds a new interface node to the graph.protected void
Performs any post processing required after all nodes and edges have been added.protected void
renderEdge
(GraphvizEdge edge) protected void
renderNode
(GraphvizNode node) protected void
reset()
Resets the state of the grapher before rendering a new graph.void
setOut
(PrintWriter out) void
setRankdir
(String rankdir) protected void
start()
Methods inherited from class com.google.inject.grapher.AbstractInjectorGrapher
graph, graph
-
Field Details
-
nodes
-
edges
-
nameFactory
-
portIdFactory
-
out
-
rankdir
-
-
Constructor Details
-
GraphvizGrapher
-
-
Method Details
-
reset
protected void reset()Description copied from class:AbstractInjectorGrapher
Resets the state of the grapher before rendering a new graph.- Specified by:
reset
in classAbstractInjectorGrapher
-
setOut
-
setRankdir
-
postProcess
protected void postProcess()Description copied from class:AbstractInjectorGrapher
Performs any post processing required after all nodes and edges have been added.- Specified by:
postProcess
in classAbstractInjectorGrapher
-
getGraphAttributes
-
start
protected void start() -
finish
protected void finish() -
renderNode
-
getNodeAttributes
-
getNodeLabel
Creates the "label" for a node. This is a string of HTML that defines a table with a heading at the top and (in the case ofImplementationNode
s) rows for each of the member fields. -
renderEdge
-
getEdgeAttributes
-
getAttrString
-
getArrowString
-
getEdgeEndPoint
-
htmlEscape
-
htmlEscape
-
newInterfaceNode
Description copied from class:AbstractInjectorGrapher
Adds a new interface node to the graph.- Specified by:
newInterfaceNode
in classAbstractInjectorGrapher
-
newImplementationNode
Description copied from class:AbstractInjectorGrapher
Adds a new implementation node to the graph.- Specified by:
newImplementationNode
in classAbstractInjectorGrapher
-
newInstanceNode
Description copied from class:AbstractInjectorGrapher
Adds a new instance node to the graph.- Specified by:
newInstanceNode
in classAbstractInjectorGrapher
-
newDependencyEdge
Description copied from class:AbstractInjectorGrapher
Adds a new dependency edge to the graph.- Specified by:
newDependencyEdge
in classAbstractInjectorGrapher
-
newBindingEdge
Description copied from class:AbstractInjectorGrapher
Adds a new binding edge to the graph.- Specified by:
newBindingEdge
in classAbstractInjectorGrapher
-
addNode
-