org.javalite.activejdbc
Enum Registry

java.lang.Object
  extended by java.lang.Enum<Registry>
      extended by org.javalite.activejdbc.Registry
All Implemented Interfaces:
Serializable, Comparable<Registry>

public enum Registry
extends Enum<Registry>

Author:
Igor Polevoy

Enum Constant Summary
INSTANCE
           
 
Method Summary
 void addListener(Class modelClass, CallbackListener listener)
           
 void addValidators(Class<? extends Model> daClass, List<? extends Validator> modelValidators)
          Deprecated. 
 void addValidators(String daClass, List<? extends Validator> modelValidators)
           
static CacheManager cacheManager()
           
 Configuration getConfiguration()
           
protected  List<String> getEdges(String join)
          Returns edges for a join.
protected  List<CallbackListener> getListeners(Class modelClass)
           
 MetaModel getMetaModel(Class<? extends Model> modelClass)
           
 MetaModel getMetaModel(String table)
          Provides a MetaModel of a model representing a table.
 MetaModel getMetaModelByClassName(String className)
          Returns MetaModel associated with a model class.
protected  Class<? extends Model> getModelClass(String table, boolean suppressException)
          Returns model class for a table name, null if not found.
 StatisticsQueue getStatisticsQueue()
           
protected  String getTableName(Class<? extends Model> modelClass)
           
protected  List<Validator> getValidators(String daClass)
           
 boolean initialized()
           
static Registry instance()
           
 void removeValidator(Class<Model> daClass, Validator validator)
           
static Registry valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Registry[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

INSTANCE

public static final Registry INSTANCE
Method Detail

values

public static Registry[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Registry c : Registry.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Registry valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

initialized

public boolean initialized()

instance

public static Registry instance()

getStatisticsQueue

public StatisticsQueue getStatisticsQueue()

getConfiguration

public Configuration getConfiguration()

cacheManager

public static CacheManager cacheManager()

getMetaModel

public MetaModel getMetaModel(String table)
Provides a MetaModel of a model representing a table.

Parameters:
table - name of table represented by this MetaModel.
Returns:
MetaModel of a model representing a table.

getMetaModelByClassName

public MetaModel getMetaModelByClassName(String className)
Returns MetaModel associated with a model class.

Parameters:
className - class name of a model.
Returns:
MetaModel associated with a model class, null if not found.

getMetaModel

public MetaModel getMetaModel(Class<? extends Model> modelClass)

getModelClass

protected Class<? extends Model> getModelClass(String table,
                                               boolean suppressException)
Returns model class for a table name, null if not found.

Parameters:
table - table name
suppressException - true to suppress exception
Returns:
model class for a table name, null if not found.s

getTableName

protected String getTableName(Class<? extends Model> modelClass)

getValidators

protected List<Validator> getValidators(String daClass)

addValidators

@Deprecated
public void addValidators(Class<? extends Model> daClass,
                                     List<? extends Validator> modelValidators)
Deprecated. 


addValidators

public void addValidators(String daClass,
                          List<? extends Validator> modelValidators)

removeValidator

public void removeValidator(Class<Model> daClass,
                            Validator validator)

getEdges

protected List<String> getEdges(String join)
Returns edges for a join. An edge is a table in a many to many relationship that is not a join. We have to go through all the associations here because join tables, (even if the model exists) will not have associations to the edges.

Parameters:
join - name of join table;
Returns:
edges for a join

getListeners

protected List<CallbackListener> getListeners(Class modelClass)

addListener

public void addListener(Class modelClass,
                        CallbackListener listener)


Copyright © 2013. All Rights Reserved.