Errai 3.0.1-SNAPSHOT

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

java.lang.Object
  extended by org.jboss.errai.ioc.rebind.ioc.graph.SortUnit
      extended by org.jboss.errai.ioc.rebind.ioc.graph.ProxySortUnit
All Implemented Interfaces:
Comparable<SortUnit>

public class ProxySortUnit
extends SortUnit

A cycle breaking proxy used by the GraphBuilder to properly construct a graph which can accurately represent cycles. A ProxySortUnit must be closed by calling setDelegate(SortUnit) before being put into use, otherwise calls to any methods will result in NullPointerException.

Author:
Mike Brock

Method Summary
 int compareTo(SortUnit o)
           
 Set<SortUnit> getDependencies()
          Returns a list of SortUnits which are depended on by this SortUnit.
 int getDepth()
          Returns the outward graph depth of this SortUnit to the outermost leaf or cycle.
 List<Object> getItems()
          Returns the list of arbitrary items associated with this sort unit.
 MetaClass getType()
          Returns the type which this sort unit represents.
static ProxySortUnit proxyOf(MetaClass type)
          Creates a new proxied SortUnit on the specified type.
 void setDelegate(SortUnit unit)
          Sets the instance of SortUnit which should be proxied on.
 String toString()
           
 
Methods inherited from class org.jboss.errai.ioc.rebind.ioc.graph.SortUnit
create, equals, hasDependency, hashCode, isCyclicGraph
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

proxyOf

public static ProxySortUnit proxyOf(MetaClass type)
Creates a new proxied SortUnit on the specified type.

Parameters:
type - the sort unit
Returns:
a new instance of ProxySortUnit

getDependencies

public Set<SortUnit> getDependencies()
Description copied from class: SortUnit
Returns a list of SortUnits which are depended on by this SortUnit.

Overrides:
getDependencies in class SortUnit
Returns:
an unmodifiable set of SortUnits which are depended on by this SortUnit.

getItems

public List<Object> getItems()
Description copied from class: SortUnit
Returns the list of arbitrary items associated with this sort unit. There is no contract on what this should be, although the order in which items are represented in the return List are guaranteed to be the same order in which they were added.

Typically items are units of work used by the container to orchestrate the generation of code in the correct order.

Overrides:
getItems in class SortUnit
Returns:
an unmodifiable list of arbitrary items.

getType

public MetaClass getType()
Description copied from class: SortUnit
Returns the type which this sort unit represents.

Overrides:
getType in class SortUnit
Returns:

getDepth

public int getDepth()
Description copied from class: SortUnit
Returns the outward graph depth of this SortUnit to the outermost leaf or cycle.

Overrides:
getDepth in class SortUnit
Returns:
the outward depth of the graph from this SortUnit.

compareTo

public int compareTo(SortUnit o)
Specified by:
compareTo in interface Comparable<SortUnit>
Overrides:
compareTo in class SortUnit

toString

public String toString()
Overrides:
toString in class SortUnit

setDelegate

public void setDelegate(SortUnit unit)
Sets the instance of SortUnit which should be proxied on.

Parameters:
unit -

Errai 3.0.1-SNAPSHOT

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