public class

GraphvizGrapher

extends AbstractInjectorGrapher
java.lang.Object
   ↳ com.google.inject.grapher.AbstractInjectorGrapher
     ↳ com.google.inject.grapher.graphviz.GraphvizGrapher

Class Overview

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).

Summary

Public Methods
void setOut(PrintWriter out)
void setRankdir(String rankdir)
Protected Methods
void finish()
String getArrowString(List<ArrowType> arrows)
Turns a List of ArrowTypes into a String that represents combining them.
Map<String, String> getEdgeAttributes(GraphvizEdge edge)
String getEdgeEndPoint(String nodeId, String portId, CompassPoint compassPoint)
Map<String, String> getGraphAttributes()
Map<String, String> getNodeAttributes(GraphvizNode node)
String getNodeLabel(GraphvizNode node)
Creates the "label" for a node.
String htmlEscape(String str)
List<String> htmlEscape(List<String> elements)
void newBindingEdge(BindingEdge edge)
Adds a new binding edge to the graph.
void newDependencyEdge(DependencyEdge edge)
Adds a new dependency edge to the graph.
void newImplementationNode(ImplementationNode node)
Adds a new implementation node to the graph.
void newInstanceNode(InstanceNode node)
Adds a new instance node to the graph.
void newInterfaceNode(InterfaceNode node)
Adds a new interface node to the graph.
void postProcess()
Performs any post processing required after all nodes and edges have been added.
void renderEdge(GraphvizEdge edge)
void renderNode(GraphvizNode node)
void reset()
Resets the state of the grapher before rendering a new graph.
void start()
[Expand]
Inherited Methods
From class com.google.inject.grapher.AbstractInjectorGrapher
From class java.lang.Object
From interface com.google.inject.grapher.InjectorGrapher

Public Methods

public void setOut (PrintWriter out)

public void setRankdir (String rankdir)

Protected Methods

protected void finish ()

protected String getArrowString (List<ArrowType> arrows)

Turns a List of ArrowTypes into a String that represents combining them. With Graphviz, that just means concatenating them.

protected Map<String, String> getEdgeAttributes (GraphvizEdge edge)

protected String getEdgeEndPoint (String nodeId, String portId, CompassPoint compassPoint)

protected Map<String, String> getGraphAttributes ()

protected Map<String, String> getNodeAttributes (GraphvizNode node)

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 of ImplementationNodes) rows for each of the member fields.

protected String htmlEscape (String str)

protected List<String> htmlEscape (List<String> elements)

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.

protected void start ()