public class GraphvizGrapher extends AbstractInjectorGrapher
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)
.
AbstractInjectorGrapher.GrapherParameters
Modifier and Type | Method and Description |
---|---|
protected void |
finish() |
protected java.lang.String |
getArrowString(java.util.List<ArrowType> arrows)
|
protected java.util.Map<java.lang.String,java.lang.String> |
getEdgeAttributes(GraphvizEdge edge) |
protected java.lang.String |
getEdgeEndPoint(java.lang.String nodeId,
java.lang.String portId,
CompassPoint compassPoint) |
protected java.util.Map<java.lang.String,java.lang.String> |
getGraphAttributes() |
protected java.util.Map<java.lang.String,java.lang.String> |
getNodeAttributes(GraphvizNode node) |
protected java.lang.String |
getNodeLabel(GraphvizNode node)
Creates the "label" for a node.
|
protected java.util.List<java.lang.String> |
htmlEscape(java.util.List<java.lang.String> elements) |
protected java.lang.String |
htmlEscape(java.lang.String str) |
protected void |
newBindingEdge(BindingEdge edge)
Adds a new binding edge to the graph.
|
protected void |
newDependencyEdge(DependencyEdge edge)
Adds a new dependency edge to the graph.
|
protected void |
newImplementationNode(ImplementationNode node)
Adds a new implementation node to the graph.
|
protected void |
newInstanceNode(InstanceNode node)
Adds a new instance node to the graph.
|
protected void |
newInterfaceNode(InterfaceNode node)
Adds a new interface node to the graph.
|
protected void |
postProcess()
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(java.io.PrintWriter out) |
void |
setRankdir(java.lang.String rankdir) |
protected void |
start() |
graph, graph
protected void reset()
AbstractInjectorGrapher
reset
in class AbstractInjectorGrapher
public void setOut(java.io.PrintWriter out)
public void setRankdir(java.lang.String rankdir)
protected void postProcess()
AbstractInjectorGrapher
postProcess
in class AbstractInjectorGrapher
protected java.util.Map<java.lang.String,java.lang.String> getGraphAttributes()
protected void start()
protected void finish()
protected void renderNode(GraphvizNode node)
protected java.util.Map<java.lang.String,java.lang.String> getNodeAttributes(GraphvizNode node)
protected java.lang.String getNodeLabel(GraphvizNode node)
ImplementationNode
s) rows for each of the member fields.protected void renderEdge(GraphvizEdge edge)
protected java.util.Map<java.lang.String,java.lang.String> getEdgeAttributes(GraphvizEdge edge)
protected java.lang.String getArrowString(java.util.List<ArrowType> arrows)
List
of ArrowType
s into a String
that represents combining
them. With Graphviz, that just means concatenating them.protected java.lang.String getEdgeEndPoint(java.lang.String nodeId, java.lang.String portId, CompassPoint compassPoint)
protected java.lang.String htmlEscape(java.lang.String str)
protected java.util.List<java.lang.String> htmlEscape(java.util.List<java.lang.String> elements)
protected void newInterfaceNode(InterfaceNode node)
AbstractInjectorGrapher
newInterfaceNode
in class AbstractInjectorGrapher
protected void newImplementationNode(ImplementationNode node)
AbstractInjectorGrapher
newImplementationNode
in class AbstractInjectorGrapher
protected void newInstanceNode(InstanceNode node)
AbstractInjectorGrapher
newInstanceNode
in class AbstractInjectorGrapher
protected void newDependencyEdge(DependencyEdge edge)
AbstractInjectorGrapher
newDependencyEdge
in class AbstractInjectorGrapher
protected void newBindingEdge(BindingEdge edge)
AbstractInjectorGrapher
newBindingEdge
in class AbstractInjectorGrapher