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 NameFactoryprivate final Map<NodeId,GraphvizNode> private PrintWriterprivate final PortIdFactoryprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddNode(GraphvizNode node) protected voidfinish()protected StringgetArrowString(List<ArrowType> arrows) private StringgetAttrString(Map<String, String> attrs) protected StringgetEdgeEndPoint(String nodeId, String portId, CompassPoint compassPoint) protected StringgetNodeLabel(GraphvizNode node) Creates the "label" for a node.protected StringhtmlEscape(String str) htmlEscape(List<String> elements) protected voidnewBindingEdge(BindingEdge edge) Adds a new binding edge to the graph.protected voidAdds a new dependency edge to the graph.protected voidAdds a new implementation node to the graph.protected voidnewInstanceNode(InstanceNode node) Adds a new instance node to the graph.protected voidAdds a new interface node to the graph.protected voidPerforms 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
-
Field Details
-
nodes
-
edges
-
nameFactory
-
portIdFactory
-
out
-
rankdir
-
-
Constructor Details
-
GraphvizGrapher
-
-
Method Details
-
reset
protected void reset()Description copied from class:AbstractInjectorGrapherResets the state of the grapher before rendering a new graph.- Specified by:
resetin classAbstractInjectorGrapher
-
setOut
-
setRankdir
-
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
-
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 ofImplementationNodes) rows for each of the member fields. -
renderEdge
-
getEdgeAttributes
-
getAttrString
-
getArrowString
-
getEdgeEndPoint
-
htmlEscape
-
htmlEscape
-
newInterfaceNode
Description copied from class:AbstractInjectorGrapherAdds a new interface node to the graph.- Specified by:
newInterfaceNodein classAbstractInjectorGrapher
-
newImplementationNode
Description copied from class:AbstractInjectorGrapherAdds a new implementation node to the graph.- Specified by:
newImplementationNodein classAbstractInjectorGrapher
-
newInstanceNode
Description copied from class:AbstractInjectorGrapherAdds a new instance node to the graph.- Specified by:
newInstanceNodein classAbstractInjectorGrapher
-
newDependencyEdge
Description copied from class:AbstractInjectorGrapherAdds a new dependency edge to the graph.- Specified by:
newDependencyEdgein classAbstractInjectorGrapher
-
newBindingEdge
Description copied from class:AbstractInjectorGrapherAdds a new binding edge to the graph.- Specified by:
newBindingEdgein classAbstractInjectorGrapher
-
addNode
-