Errai 3.0.1-SNAPSHOT

org.jboss.errai.config.rebind
Class ReachableTypes

java.lang.Object
  extended by org.jboss.errai.config.rebind.ReachableTypes

public class ReachableTypes
extends Object

A class for obtaining information about whether types are reachable or not. Instances of this class can be obtained from EnvUtil.getAllReachableClasses(com.google.gwt.core.ext.GeneratorContext) .

Author:
Jonathan Fuerth

Field Summary
static ReachableTypes EVERYTHING_REACHABLE_INSTANCE
          A shareable, threadsafe, reusable instance that reports all types as reachable and reachability analysis as disabled.
 
Method Summary
 boolean add(String fqcn)
          Adds the named class as a reachable type.
 boolean contains(String fqcn)
          Returns true if the named class is reachable from the GWT module being compiled.
 boolean isBasedOnReachabilityAnalysis()
          Reports whether this ReachableTypes instance is reporting true reachability data, or if it is blindly reporting all classes as reachable.
 boolean isEmpty()
          Returns true if real reachability analysis is in use and no classes are presently considered reachable.
 boolean remove(String fqcn)
          Removed the named class as a reachable type.
 Collection<String> toCollection()
          Return a collection of all reachable types
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EVERYTHING_REACHABLE_INSTANCE

public static final ReachableTypes EVERYTHING_REACHABLE_INSTANCE
A shareable, threadsafe, reusable instance that reports all types as reachable and reachability analysis as disabled.

Method Detail

isEmpty

public boolean isEmpty()
Returns true if real reachability analysis is in use and no classes are presently considered reachable.


contains

public boolean contains(String fqcn)
Returns true if the named class is reachable from the GWT module being compiled.

Parameters:
fqcn - The fully-qualified name of the class in question.
Returns:
True if reachability analysis found the named class or if reachability analysis is disabled.

add

public boolean add(String fqcn)
Adds the named class as a reachable type.

Parameters:
fqcn - The fully-qualified name of the class that should be considered reachable.
Returns:
True if reachability analysis is enabled and the given class was not already in the reachable set. False otherwise.

remove

public boolean remove(String fqcn)
Removed the named class as a reachable type.

Parameters:
fqcn - The fully-qualified name of the class that should be considered unreachable.
Returns:
True if reachability analysis is enabled and the given class was previously in the reachable set. False otherwise.

isBasedOnReachabilityAnalysis

public boolean isBasedOnReachabilityAnalysis()
Reports whether this ReachableTypes instance is reporting true reachability data, or if it is blindly reporting all classes as reachable.

Returns:
True if real reachability data is in use; false if all classes will be considered reachable.

toCollection

public Collection<String> toCollection()
Return a collection of all reachable types

Returns:
an unmodifiable collection of all reachable types. returns null if everything is reachable.

Errai 3.0.1-SNAPSHOT

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