com.ibm.dse.base.types
Interface Type

All Known Implementing Classes:
DSEType

public interface Type

This interface is implemented by DSEType, a concrete class which defines a type of business object or business process.


Method Summary
 PropertyDescription addPropertyDescriptor(PropertyDescription propertyDescriptor)
          Adds the PropertyDescriptor passed as argument to the list of contained descriptors and if successful, the PropertyDescriptor added is returned.
 java.lang.Object createInstance()
          Returns a business object populated with the default data specified for this Type.
 java.lang.Object createInstance(PropertyDescription propertyDescriptor)
          Returns a business object populated with the default data specified for this Type.
 PropertyDescription getDefaultDescriptorForType()
          Returns the PropertyDescriptor associated with this Type which defines its business rules.
 java.lang.Class getImplClass()
          Returns the class which implements the business behaviour described by this Type.
 Key getKey(TypedData businessObject)
          Returns a Key object which can, if the Type has unique Keys, be used to identify the business object passed as argument.
 KeyBuilder getKeyBuilder()
          Returns the KeyBuilder responsible for building Keys for this Type.
 java.lang.String getName()
          Returns the name of this Type.
 PropertyDescription getPropertyDescriptor(int index)
          Returns the PropertyDescriptor at the index passed
 PropertyDescription getPropertyDescriptor(java.lang.String name)
          Returns the PropertyDescriptor with the name passed, or null is no descriptor of that name exists.
 java.util.Enumeration getPropertyDescriptors()
          Returns an Enumeration of all PropertyDescriptors contained within this Type.
 boolean isCompound()
          Retruns a flag indicating whether this Type is Compound or not.
 void reset()
          Resets the type
 void reset(Type newType)
          Resets the type with a new Type instance
 void setDefaultDescriptorForType(PropertyDescription propertyDescriptor)
          Sets the default PropertyDescriptor which defines this Types business rules to that passed as argument.
 void setKeyBuilder(KeyBuilder keyBuilder)
          Sets the KeyBuilder which is responsible for building Keys for this Type to that passed.
 

Method Detail

addPropertyDescriptor

public PropertyDescription addPropertyDescriptor(PropertyDescription propertyDescriptor)
                                          throws DSETypeException
Adds the PropertyDescriptor passed as argument to the list of contained descriptors and if successful, the PropertyDescriptor added is returned.
Parameters:
propertyDescriptor - PropertyDescription
Returns:
PropertyDescription
Throws:
DSETypeException - Name of PropertyDescriptor to add is either null or a duplicate.

createInstance

public java.lang.Object createInstance()
                                throws DSETypeException
Returns a business object populated with the default data specified for this Type.

Compond Types return a KeyedCollection, Simple Types return a DataField with a business object as value. The business object returned is associated with the defualt PropertyDescriptor for this Type.

Returns:
TypedData
Throws:
DSETypeException - Object creation is unsuccessful.

createInstance

public java.lang.Object createInstance(PropertyDescription propertyDescriptor)
                                throws DSETypeException
Returns a business object populated with the default data specified for this Type.

Compond Types return a KeyedCollection, Simple Types return a DataField with a business object as value. The PropertyDescriptor to be associated with the business object created is passed as argument.

Parameters:
propertyDescriptor - PropertyDescription
Returns:
TypedData
Throws:
DSETypeException - Object creation is unsuccessful.

getDefaultDescriptorForType

public PropertyDescription getDefaultDescriptorForType()
Returns the PropertyDescriptor associated with this Type which defines its business rules.
Returns:
PropertyDescription

getImplClass

public java.lang.Class getImplClass()
Returns the class which implements the business behaviour described by this Type.
Returns:
Class

getKey

public Key getKey(TypedData businessObject)
           throws DSETypeException
Returns a Key object which can, if the Type has unique Keys, be used to identify the business object passed as argument.

This behaviour may be delegated to a utility object since Types are to be employed, not subclassed. Returns a Key with a value of zero for all Types, including Simple Types, which do not have unique Keys.

Parameters:
businessObject - TypedData
Returns:
Key
Throws:
DSETypeException - - If the building of the key for the businessObject given fails.

getKeyBuilder

public KeyBuilder getKeyBuilder()
Returns the KeyBuilder responsible for building Keys for this Type.
Returns:
KeyBuilder

getName

public java.lang.String getName()
Returns the name of this Type.
Returns:
String

getPropertyDescriptor

public PropertyDescription getPropertyDescriptor(int index)
Returns the PropertyDescriptor at the index passed
Parameters:
index - int
Returns:
com.ibm.dse.base.types.PropertyDescription

getPropertyDescriptor

public PropertyDescription getPropertyDescriptor(java.lang.String name)
Returns the PropertyDescriptor with the name passed, or null is no descriptor of that name exists.
Parameters:
name - String
Returns:
PropertyDescription

getPropertyDescriptors

public java.util.Enumeration getPropertyDescriptors()
Returns an Enumeration of all PropertyDescriptors contained within this Type.
Returns:
Enumeration

isCompound

public boolean isCompound()
Retruns a flag indicating whether this Type is Compound or not.
Returns:
boolean

reset

public void reset()
           throws DSETypeException
Resets the type
Throws:
DSETypeException - if the type cannot be reset

reset

public void reset(Type newType)
           throws DSETypeException
Resets the type with a new Type instance
Parameters:
newType - com.ibm.dse.base.types.DSEType
Throws:
DSETypeException - if the type cannot be reset

setDefaultDescriptorForType

public void setDefaultDescriptorForType(PropertyDescription propertyDescriptor)
Sets the default PropertyDescriptor which defines this Types business rules to that passed as argument.
Parameters:
propertyDescriptor - PropertyDescription

setKeyBuilder

public void setKeyBuilder(KeyBuilder keyBuilder)
Sets the KeyBuilder which is responsible for building Keys for this Type to that passed.
Parameters:
keyBuilder - KeyBuilder