Expresso 5-6

com.jcorporate.expresso.core.dataobjects
Class DataObjectFactory

java.lang.Object
  extended bycom.jcorporate.expresso.core.dataobjects.DataObjectFactory

public final class DataObjectFactory
extends Object

Constructs 'often' DataObjects based upon standard order of initialization and the interfaces it implements. For example, Defineable objects must have setDefinition() called first, then setDataContext(), then setUid()

Author:
Michael Rimov

Method Summary
static DataObject createDataObject(Class clazz, String dataContext, int uid)
          Typesafe way of creating a data object that doesn't implement Defineable
static DataObject createDataObject(Class clazz, String dataContext, String definition, int uid)
          Typesafe way of creating a dataobject
static Object createObject(Class clazz, String dataContext, int uid)
          Creates an object that doesn't implement Defineable.
static Object createObject(Class clazz, String dataContext, String definition, int uid)
          Create an object given the class, datacontext, definition and uid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createObject

public static Object createObject(Class clazz,
                                  String dataContext,
                                  int uid)
                           throws DataException
Creates an object that doesn't implement Defineable.

Parameters:
clazz - Object class name
dataContext - Database context
uid - the user id that will be set if the object is Securable
Returns:
an instantiated and properly constructed object.
Throws:
DataException - upon error

createDataObject

public static DataObject createDataObject(Class clazz,
                                          String dataContext,
                                          int uid)
                                   throws DataException
Typesafe way of creating a data object that doesn't implement Defineable

Parameters:
clazz - Object class
dataContext - Database context
uid - the user id that will be set if the object is Securable
Returns:
an instantiated and properly constructed object.
Throws:
DataException - upon error

createDataObject

public static DataObject createDataObject(Class clazz,
                                          String dataContext,
                                          String definition,
                                          int uid)
                                   throws DataException
Typesafe way of creating a dataobject

Parameters:
definition - The definition to define the Defineable Object. If the object does not implement Defineable, this parameter may be null.
clazz - Object class
dataContext - Database context
uid - the user id that will be set if the object is Securable
Returns:
an instantiated and properly constructed DataObject.
Throws:
DataException - upon error

createObject

public static Object createObject(Class clazz,
                                  String dataContext,
                                  String definition,
                                  int uid)
                           throws DataException
Create an object given the class, datacontext, definition and uid.

Parameters:
definition - The definition to define the Defineable Object. If the object does not implement Defineable, this parameter may be null.
clazz - Object class
dataContext - Database context
uid - the user id that will be set if the object is Securable
Returns:
an instantiated and properly constructed object.
Throws:
DataException - upon error

Expresso 5-6

Please see www.jcorporate.com for information about new Expresso releases.