public final class DBObjectRegistry
extends java.lang.Object
| Constructor and Description | 
|---|
DBObjectRegistry()  | 
| Modifier and Type | Method and Description | 
|---|---|
java.util.Map<java.lang.String,DBObjectBuilder> | 
getBuilders(java.lang.String dbType, int version, DBObjectProvider pro)  | 
java.util.Map<java.lang.String,DDLGenerator> | 
getDDLGenerators(Database db)  | 
java.util.Map<java.lang.String,DDLGenerator> | 
getDDLGenerators(java.lang.String dbType, int version, java.lang.Class<? extends Database> dbClz, DBObjectProvider pro)  | 
static DBObjectRegistry | 
getInstance()
Gets the single instance of the DBObjectRegistry. 
 | 
java.util.Map<java.lang.String,DBObjectLister> | 
getListers(java.lang.String dbType, int version, DBObjectProvider pro)  | 
java.util.Map<java.lang.String,DBObjectValidator> | 
getValidators(java.lang.String dbType, int version, DBObjectProvider pro)  | 
static boolean | 
isActive()
Tests whether the DBObjectRegistry has been used yet (i.e. 
 | 
static boolean | 
isExtensionType(java.lang.String objType, java.lang.String dbType, int dbVersion)
Tests whether the DBObjectRegistry has been initialized and the given object type is a registered extension of a particular database type and version. 
 | 
void | 
registerClass(java.lang.String objType, java.lang.Class<? extends DBObject> objClz)
Registers the given object type and class with the api's metadata layer. 
 | 
void | 
registerClass(java.lang.String objType, Thunk<java.lang.Class<? extends DBObject>> objClz)
Registers the given object type and class with the api's metadata layer. 
 | 
void | 
registerObject(java.lang.String objType, DatabaseMatcher dbMatch, java.lang.Class<? extends DBObjectValidator> validatorClz, java.lang.Class<? extends DBObjectBuilder> builderClz, java.lang.Class<? extends DBObjectLister> listClz, java.lang.Class<? extends DDLGenerator> ddlGenClz)
Registers a new object type with the releveant components for making it function within the API. 
 | 
void | 
registerObject(java.lang.String objType, DatabaseMatcher dbMatch, Thunk<java.lang.Class<? extends DBObjectValidator>> validatorClz, Thunk<java.lang.Class<? extends DBObjectBuilder>> builderClz, Thunk<java.lang.Class<? extends DBObjectLister>> listClz, Thunk<java.lang.Class<? extends DDLGenerator>> ddlGenClz)
Registers a new object type with the releveant components for making it function within the API. 
 | 
public java.util.Map<java.lang.String,DBObjectValidator> getValidators(java.lang.String dbType, int version, DBObjectProvider pro)
public java.util.Map<java.lang.String,DBObjectBuilder> getBuilders(java.lang.String dbType, int version, DBObjectProvider pro)
public java.util.Map<java.lang.String,DBObjectLister> getListers(java.lang.String dbType, int version, DBObjectProvider pro)
public java.util.Map<java.lang.String,DDLGenerator> getDDLGenerators(Database db)
public java.util.Map<java.lang.String,DDLGenerator> getDDLGenerators(java.lang.String dbType, int version, java.lang.Class<? extends Database> dbClz, DBObjectProvider pro)
public void registerObject(java.lang.String objType,
                  DatabaseMatcher dbMatch,
                  java.lang.Class<? extends DBObjectValidator> validatorClz,
                  java.lang.Class<? extends DBObjectBuilder> builderClz,
                  java.lang.Class<? extends DBObjectLister> listClz,
                  java.lang.Class<? extends DDLGenerator> ddlGenClz)
This must be done after a call to registerClass to register the DBObject implementation class against the same type.
objType - the type of objectdbMatch - the matcher to define which database/versions it is supported forvalidatorClz - for validating the object definition (should have a constructor that takes a single DBObjectProvider)builderClz - the building the object definition from the database dictionary (should have a constructor that takes a single DBObjectProvider)listClz - the lister for listing avaiable objects of from the database (should have a constructor that takes a single DBObjectProvider)ddlGenClz - the generator for constructing ddl syntax for the create/update/delete of the object type (should have a constructor that takes Class<? extends Database>, DBObjectProvider
public void registerObject(java.lang.String objType,
                  DatabaseMatcher dbMatch,
                  Thunk<java.lang.Class<? extends DBObjectValidator>> validatorClz,
                  Thunk<java.lang.Class<? extends DBObjectBuilder>> builderClz,
                  Thunk<java.lang.Class<? extends DBObjectLister>> listClz,
                  Thunk<java.lang.Class<? extends DDLGenerator>> ddlGenClz)
This must be done after a call to registerClass to register the DBObject implementation class against the same type.
All of the Class parameters take a Thunk to provide a level of indirection allowing the ClassLoading to be delayed until necessary.
objType - the type of objectdbMatch - the matcher to define which database/versions it is supported forvalidatorClz - for validating the object definition (should have a constructor that takes a single DBObjectProvider)builderClz - the building the object definition from the database dictionary (should have a constructor that takes a single DBObjectProvider)listClz - the lister for listing avaiable objects of from the database (should have a constructor that takes a single DBObjectProvider)ddlGenClz - the generator for constructing ddl syntax for the create/update/delete of the object type (should have a constructor that takes Class<? extends Database>, DBObjectProvider
public void registerClass(java.lang.String objType,
                 java.lang.Class<? extends DBObject> objClz)
objType - the new DBObject type to registerobjClz - the DBObject implementation class for the new type
public void registerClass(java.lang.String objType,
                 Thunk<java.lang.Class<? extends DBObject>> objClz)
objType - the new DBObject type to registerobjClz - a Thunk that contains the the DBObject implementation class for the new typepublic static DBObjectRegistry getInstance()
isActive() first.public static boolean isActive()
public static boolean isExtensionType(java.lang.String objType,
                      java.lang.String dbType,
                      int dbVersion)
objType - the object type to testdbType - the database type to matchdbVersion - the database version to match