Errai 3.0.1-SNAPSHOT

org.jboss.errai.ioc.rebind.ioc.graph
Class GraphBuilder

java.lang.Object
  extended by org.jboss.errai.ioc.rebind.ioc.graph.GraphBuilder

public class GraphBuilder
extends Object

Builds a dependency graph for use by the container.

Author:
Mike Brock

Constructor Summary
GraphBuilder()
           
 
Method Summary
 GraphBuilder addDependency(MetaClass type, Dependency dependency)
          Records a dependency on the specified type.
 GraphBuilder addItem(MetaClass type, Object item)
          Record an arbitrary object to be associated with a type.
 List<SortUnit> build()
          Returns a graph of only incoming edges for use in a topological sort.
 int getDependencyCount(MetaClass type)
          Returns the number of recorded dependencies for the specified type.
 boolean hasType(MetaClass type)
           
 String toDOTRepresentation()
           
static String toDOTRepresentation(List<SortUnit> graph)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphBuilder

public GraphBuilder()
Method Detail

addDependency

public GraphBuilder addDependency(MetaClass type,
                                  Dependency dependency)
Records a dependency on the specified type.

Parameters:
type - the type to record a dependency on.
dependency - the depedency
Returns:
the same instance of the GraphBuilder that called this method.

addItem

public GraphBuilder addItem(MetaClass type,
                            Object item)
Record an arbitrary object to be associated with a type.

Parameters:
type - the type to record the item for.
item - the arbitrary object
Returns:
the same instance of the GraphBuilder that called this method.

getDependencyCount

public int getDependencyCount(MetaClass type)
Returns the number of recorded dependencies for the specified type.

Parameters:
type - the type to query for the number of dependencies.
Returns:
the number of dependencies for the specified type.

build

public List<SortUnit> build()
Returns a graph of only incoming edges for use in a topological sort.

Returns:
a list of incoming edges in the graph.

toDOTRepresentation

public String toDOTRepresentation()

toDOTRepresentation

public static String toDOTRepresentation(List<SortUnit> graph)

hasType

public boolean hasType(MetaClass type)

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.