Class GraphvizGrapher
- java.lang.Object
-
- com.google.inject.grapher.AbstractInjectorGrapher
-
- com.google.inject.grapher.graphviz.GraphvizGrapher
-
- All Implemented Interfaces:
InjectorGrapher
public class GraphvizGrapher extends AbstractInjectorGrapher
InjectorGrapherimplementation that writes out a Graphviz DOT file of the graph. Dependencies are bound inGraphvizModule.Specify the
PrintWriterto output to withsetOut(PrintWriter).- Since:
- 4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.inject.grapher.AbstractInjectorGrapher
AbstractInjectorGrapher.GrapherParameters
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfinish()protected StringgetArrowString(List<ArrowType> arrows)protected Map<String,String>getEdgeAttributes(GraphvizEdge edge)protected StringgetEdgeEndPoint(String nodeId, String portId, CompassPoint compassPoint)protected Map<String,String>getGraphAttributes()protected Map<String,String>getNodeAttributes(GraphvizNode node)protected StringgetNodeLabel(GraphvizNode node)Creates the "label" for a node.protected StringhtmlEscape(String str)protected List<String>htmlEscape(List<String> elements)protected voidnewBindingEdge(BindingEdge edge)Adds a new binding edge to the graph.protected voidnewDependencyEdge(DependencyEdge edge)Adds a new dependency edge to the graph.protected voidnewImplementationNode(ImplementationNode node)Adds a new implementation node to the graph.protected voidnewInstanceNode(InstanceNode node)Adds a new instance node to the graph.protected voidnewInterfaceNode(InterfaceNode node)Adds a new interface node to the graph.protected voidpostProcess()Performs any post processing required after all nodes and edges have been added.protected voidrenderEdge(GraphvizEdge edge)protected voidrenderNode(GraphvizNode node)protected voidreset()Resets the state of the grapher before rendering a new graph.voidsetOut(PrintWriter out)voidsetRankdir(String rankdir)protected voidstart()-
Methods inherited from class com.google.inject.grapher.AbstractInjectorGrapher
graph, graph
-
-
-
-
Method Detail
-
reset
protected void reset()
Description copied from class:AbstractInjectorGrapherResets the state of the grapher before rendering a new graph.- Specified by:
resetin classAbstractInjectorGrapher
-
setOut
public void setOut(PrintWriter out)
-
setRankdir
public void setRankdir(String rankdir)
-
postProcess
protected void postProcess()
Description copied from class:AbstractInjectorGrapherPerforms any post processing required after all nodes and edges have been added.- Specified by:
postProcessin classAbstractInjectorGrapher
-
start
protected void start()
-
finish
protected void finish()
-
renderNode
protected void renderNode(GraphvizNode node)
-
getNodeAttributes
protected Map<String,String> getNodeAttributes(GraphvizNode node)
-
getNodeLabel
protected String getNodeLabel(GraphvizNode node)
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 ofImplementationNodes) rows for each of the member fields.
-
renderEdge
protected void renderEdge(GraphvizEdge edge)
-
getEdgeAttributes
protected Map<String,String> getEdgeAttributes(GraphvizEdge edge)
-
getEdgeEndPoint
protected String getEdgeEndPoint(String nodeId, String portId, CompassPoint compassPoint)
-
newInterfaceNode
protected void newInterfaceNode(InterfaceNode node)
Description copied from class:AbstractInjectorGrapherAdds a new interface node to the graph.- Specified by:
newInterfaceNodein classAbstractInjectorGrapher
-
newImplementationNode
protected void newImplementationNode(ImplementationNode node)
Description copied from class:AbstractInjectorGrapherAdds a new implementation node to the graph.- Specified by:
newImplementationNodein classAbstractInjectorGrapher
-
newInstanceNode
protected void newInstanceNode(InstanceNode node)
Description copied from class:AbstractInjectorGrapherAdds a new instance node to the graph.- Specified by:
newInstanceNodein classAbstractInjectorGrapher
-
newDependencyEdge
protected void newDependencyEdge(DependencyEdge edge)
Description copied from class:AbstractInjectorGrapherAdds a new dependency edge to the graph.- Specified by:
newDependencyEdgein classAbstractInjectorGrapher
-
newBindingEdge
protected void newBindingEdge(BindingEdge edge)
Description copied from class:AbstractInjectorGrapherAdds a new binding edge to the graph.- Specified by:
newBindingEdgein classAbstractInjectorGrapher
-
-