com.google.inject.grapher
Class InjectorGrapher

java.lang.Object
  extended by com.google.inject.grapher.InjectorGrapher

public class InjectorGrapher
extends Object

Root class for graphing an Injector. Bound in GrapherModule.

Use of(Injector) to specify the Injector to use, and graph() to graph the Injector using the currently-bound Renderer.

By default, this will graph the entire Injector. Use rootedAt(Class...) to specify an initial set of Classes to use, and this will graph their transitive bindings and dependencies.

Author:
phopkins@gmail.com (Pete Hopkins)

Constructor Summary
InjectorGrapher(BindingTargetVisitor<Object,Collection<Key<?>>> keyVisitor, BindingTargetVisitor<Object,Void> graphingVisitor, Renderer renderer)
           
 
Method Summary
 void graph()
          Renders a graph with the bound Renderer.
 InjectorGrapher of(Injector injector)
          Sets the Injector to graph.
 InjectorGrapher rootedAt(Class<?>... classes)
          Sets an initial group of Classes to use as the starting point for the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InjectorGrapher

@Inject
public InjectorGrapher(BindingTargetVisitor<Object,Collection<Key<?>>> keyVisitor,
                              BindingTargetVisitor<Object,Void> graphingVisitor,
                              Renderer renderer)
Method Detail

of

public InjectorGrapher of(Injector injector)
Sets the Injector to graph.


rootedAt

public InjectorGrapher rootedAt(Class<?>... classes)
Sets an initial group of Classes to use as the starting point for the graph. The graph will be of these classes and their transitive dependencies and bindings.


graph

public void graph()
           throws IOException
Renders a graph with the bound Renderer. The Injector must have already been specified with of(Injector).

Throws:
IOException


Copyright © 2006-2011 Google, Inc.. All Rights Reserved.