IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base.types
Class DSEType

java.lang.Object
  extended by com.ibm.btt.base.types.DSEType
All Implemented Interfaces:
Type, TypeConstants

public class DSEType
extends java.lang.Object
implements Type, TypeConstants

This class provides an implementation of the Type interface that defines the type of the business object or business process. Associated PropertyDescriptors configure this definition. There are PropertyDescriptors that describe the structure of the type and a single PropertyDescriptor that defines the default business rules for business objects of the Type.


Field Summary
static java.lang.String errorMsgsDynaInfoEndDelim
          The end delimiter for dynamic error Messages
static java.lang.String errorMsgsDynaInfoStartDelim
          The start delimiter for dynamic error messages
static DSETypeExternalizer externalizer
           
(package private) static java.lang.Object RESOURCE_BUNDLE_NOT_DEFINED
          Empty object which is put in the cache where no locale .properties file is available
static java.util.Hashtable resTypesCache
          Cache of locales ResourcesBundles for types_locale.prperties
static java.util.Hashtable resTypesExtCache
          Cache of locales ResourcesBundles for typesext_locale.properties
static java.lang.Boolean shareDescriptors
          The Boolean to store the shareDataDescriptor flag defined in the btt.xml
 
Fields inherited from interface com.ibm.btt.base.types.TypeConstants
amended, CONV_TYPE_DEFAULT, CONV_TYPE_HOST, CONV_TYPE_HTML, CONV_TYPE_OUTPUT, CONV_TYPE_SER, CONV_TYPE_XML, disabled, hidden, isAmended, isDisabled, isHidden, isMandatory, isOmitted, isReadOnly, mandatory, omitted, readOnly, TYPE_DEFAULT, TYPE_REGISTRY_INIT_SIZE
 
Constructor Summary
DSEType(java.lang.String name, java.lang.String implClassName)
          This constructor creates a DSEType with the name and implementing class passed as argument.
 
Method Summary
 PropertyDescription addPropertyDescriptor(PropertyDescription descriptor)
          Adds the PropertyDescriptor passed as argument to the list of contained descriptors and, if successful, returns the added PropertyDescriptor.
 PropertyDescription addSharedDescriptor(PropertyDescription descriptor, java.lang.String newDescriptorName)
          Adds the existing PropertyDescriptor with the newDescriptorname to the list of contained descriptors and, if successful, returns the added PropertyDescriptor.
 java.lang.Object createInstance()
          Returns a business object populated with the default data specified for this Type.
 java.lang.Object createInstance(PropertyDescription descriptor)
          Returns a business object populated with the default data specified for this Type.
 java.lang.Object createInstance(PropertyDescription descriptor, Hashtable parameters)
          Returns a business object populated with the default data specified for this Type.
 java.lang.Object createInstanceSharingDescriptors(PropertyDescription descriptor, Hashtable parameters, java.lang.String newDescriptorName)
          Returns a business object populated with the default data specified for this Type.
 java.lang.Object createInstanceSharingDescriptors(PropertyDescription descriptor, java.lang.String newDescriptorName)
          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.util.List getDescriptorNames()
           
static java.lang.String getErrorMsgsDynaInfoEndDelim()
          Gets the errorMsgsDynaInfoEndDelim.
static java.lang.String getErrorMsgsDynaInfoStartDelim()
          Gets the errorMsgsDynaInfoStartDelim.
static DSETypeExternalizer getExternalizer()
          Gets the externalizer.
 java.lang.Class getImplClass()
          Returns the class that implements the business behavior 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.
static java.lang.String getMessageFromLocale(java.lang.String code, java.util.Locale locale)
          Returns the message associated with this locale.
 java.lang.String getName()
          Returns the name of this Type.
 PropertyDescription getPropertyDescriptor(int index)
          Returns the PropertyDescriptor at the index position.
 PropertyDescription getPropertyDescriptor(java.lang.String name)
          Returns the PropertyDescriptor with the name passed, or null if no descriptor of that name exists.
 java.util.Enumeration getPropertyDescriptors()
          Returns an Enumeration of all PropertyDescriptors contained within this Type.
static java.util.ResourceBundle getResTypes()
          Returns the resTypes.
static java.util.ResourceBundle getResTypesExt()
          Returns the resTypesExt.
static boolean getShareDescriptors()
          Gets the shareDataDescriptors flag.
protected  void initializeBusinessObjectState(ElementState iniState, Hashtable parameters)
          Initializes the ElementStae passed based on the attributes defined in the parameters Hashtable.
 boolean isCompound()
          Returns a flag indicating whether this Type is Compound or not.
static java.lang.Object readObject(java.lang.String name)
          Instantiates a Typed Data Element named: name, from the definition file.
 void reset()
          Resets this type.
 void reset(Type newType)
          Resets this type with a new Type instance.
 void setDefaultDescriptorForType(PropertyDescription defaultDescriptor)
          Sets the default PropertyDescriptor that defines this Type's business rules.
static void setErrorMsgsDynaInfoEndDelim(java.lang.String errorMsgDynaInfoEndDelimToSet)
          Sets the errorMsgsDynaInfoEndDelim property.
static void setErrorMsgsDynaInfoStartDelim(java.lang.String errorMsgDynStartDelimToSet)
          Sets the errorMsgsDynaInfoStartDelim property.
static void setExternalizer(DSETypeExternalizer anExternalizer)
          Sets the externalizer.
 void setKeyBuilder(KeyBuilder keyBuilder)
          Sets the KeyBuilder that builds Keys for this Type.
static void setResTypes(java.util.ResourceBundle resTypes)
          Sets the resTypes.
static void setResTypesExt(java.util.ResourceBundle resTypesExt)
          Sets the resTypesExt.
static void setShareDescriptors(boolean newShareDescriptors)
          Sets the shareDescriptor property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resTypesCache

public static java.util.Hashtable resTypesCache
Cache of locales ResourcesBundles for types_locale.prperties


resTypesExtCache

public static java.util.Hashtable resTypesExtCache
Cache of locales ResourcesBundles for typesext_locale.properties


RESOURCE_BUNDLE_NOT_DEFINED

static java.lang.Object RESOURCE_BUNDLE_NOT_DEFINED
Empty object which is put in the cache where no locale .properties file is available


externalizer

public static DSETypeExternalizer externalizer

shareDescriptors

public static java.lang.Boolean shareDescriptors
The Boolean to store the shareDataDescriptor flag defined in the btt.xml


errorMsgsDynaInfoStartDelim

public static java.lang.String errorMsgsDynaInfoStartDelim
The start delimiter for dynamic error messages


errorMsgsDynaInfoEndDelim

public static java.lang.String errorMsgsDynaInfoEndDelim
The end delimiter for dynamic error Messages

Constructor Detail

DSEType

public DSEType(java.lang.String name,
               java.lang.String implClassName)
        throws DSETypeException
This constructor creates a DSEType with the name and implementing class passed as argument.

Parameters:
name - String
implClassName - String
Throws:
DSETypeException
Method Detail

addPropertyDescriptor

public PropertyDescription addPropertyDescriptor(PropertyDescription descriptor)
                                          throws DSETypeException
Adds the PropertyDescriptor passed as argument to the list of contained descriptors and, if successful, returns the added PropertyDescriptor.

Specified by:
addPropertyDescriptor in interface Type
Parameters:
descriptor - PropertyDescription
Returns:
PropertyDescriptor
Throws:
DSETypeException - - Name of PropertyDescriptor to add is either null or a duplicate

addSharedDescriptor

public PropertyDescription addSharedDescriptor(PropertyDescription descriptor,
                                               java.lang.String newDescriptorName)
                                        throws DSETypeException
Adds the existing PropertyDescriptor with the newDescriptorname to the list of contained descriptors and, if successful, returns the added PropertyDescriptor.

Returns:
PropertyDescriptor
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. Compound Types return a KeyedCollection and simple Types return a DataField with a business object as value. The business object returned is associated with the default PropertyDescriptor for this Type.

Specified by:
createInstance in interface Type
Returns:
TypedData
Throws:
DSETypeException - - Object creation is unsuccessful

createInstance

public java.lang.Object createInstance(PropertyDescription descriptor)
                                throws DSETypeException
Returns a business object populated with the default data specified for this Type. Compond Types return a KeyedCollection and simple Types return a DataField with a business object as value. The PropertyDescriptor to be associated with the created business object and a Hashtable of parameters are passed as an argument.

Specified by:
createInstance in interface Type
Parameters:
descriptor - PropertyDescription
Returns:
TypedData
Throws:
DSETypeException - - Object creation is unsuccessful

createInstance

public java.lang.Object createInstance(PropertyDescription descriptor,
                                       Hashtable parameters)
                                throws DSETypeException
Returns a business object populated with the default data specified for this Type. Compond Types return a KeyedCollection and simple Types return a DataField with a business object as value. The PropertyDescriptor to be associated with the created business object and a Hashtable of parameters are passed as an argument.

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

createInstanceSharingDescriptors

public java.lang.Object createInstanceSharingDescriptors(PropertyDescription descriptor,
                                                         Hashtable parameters,
                                                         java.lang.String newDescriptorName)
                                                  throws DSETypeException
Returns a business object populated with the default data specified for this Type. Either the descriptor passed or the inner descriptors for the Type may be shared with other types. If this is the case, the new descriptorName is used to set the name of the business object. Compond Types return a KeyedCollection and simple Types return a DataField with a business object as value. The PropertyDescriptor to be associated with the created business object and a Hashtable of parameters are passed as an argument.

Specified by:
createInstanceSharingDescriptors in interface Type
Returns:
TypedData
Throws:
DSETypeException - - Object creation is unsuccessful

createInstanceSharingDescriptors

public java.lang.Object createInstanceSharingDescriptors(PropertyDescription descriptor,
                                                         java.lang.String newDescriptorName)
                                                  throws DSETypeException
Returns a business object populated with the default data specified for this Type. Either the descriptor passed or the inner descriptors for the Type may be shared with other types. This method uses the new descriptorName, if it is defined, to set the name of the business object. Compond Types return a KeyedCollection and simple Types return a DataField with a business object as value. The PropertyDescriptor to be associated with the created business object and a Hashtable of parameters are passed as argument.

Specified by:
createInstanceSharingDescriptors in interface Type
Returns:
TypedData
Throws:
DSETypeException - - Object creation is unsuccessful

getDefaultDescriptorForType

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

Specified by:
getDefaultDescriptorForType in interface Type
Returns:
PropertyDescription

getErrorMsgsDynaInfoEndDelim

public static java.lang.String getErrorMsgsDynaInfoEndDelim()
Gets the errorMsgsDynaInfoEndDelim.


getErrorMsgsDynaInfoStartDelim

public static java.lang.String getErrorMsgsDynaInfoStartDelim()
Gets the errorMsgsDynaInfoStartDelim.


getExternalizer

public static DSETypeExternalizer getExternalizer()
                                           throws DSETypeException
Gets the externalizer.

Returns:
DSETypeExternalizer
Throws:
DSETypeException

getImplClass

public java.lang.Class getImplClass()
Returns the class that implements the business behavior described by this Type.

Specified by:
getImplClass in interface 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 behavior 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.

Specified by:
getKey in interface Type
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.

Specified by:
getKeyBuilder in interface Type
Returns:
KeyBuilder

getMessageFromLocale

public static java.lang.String getMessageFromLocale(java.lang.String code,
                                                    java.util.Locale locale)
Returns the message associated with this locale.

Parameters:
code - java.lang.String
locale - java.util.Locale
Returns:
String

getName

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

Specified by:
getName in interface Type
Returns:
String

getPropertyDescriptor

public PropertyDescription getPropertyDescriptor(int index)
Returns the PropertyDescriptor at the index position.

Specified by:
getPropertyDescriptor in interface Type
Parameters:
index - int
Returns:
PropertyDescription

getPropertyDescriptor

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

Specified by:
getPropertyDescriptor in interface Type
Parameters:
name - String
Returns:
PropertyDescription

getPropertyDescriptors

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

Specified by:
getPropertyDescriptors in interface Type
Returns:
Enumeration

getShareDescriptors

public static boolean getShareDescriptors()
Gets the shareDataDescriptors flag.

Returns:
boolean - True if the descriptors are shared

initializeBusinessObjectState

protected void initializeBusinessObjectState(ElementState iniState,
                                             Hashtable parameters)
Initializes the ElementStae passed based on the attributes defined in the parameters Hashtable.


isCompound

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

Specified by:
isCompound in interface Type
Returns:
boolean - True if the Type is compound

readObject

public static java.lang.Object readObject(java.lang.String name)
                                   throws DSETypeException
Instantiates a Typed Data Element named: name, from the definition file.

Returns:
java.lang.Object
Throws:
DSETypeException

reset

public void reset()
           throws DSETypeException
Resets this type.

Specified by:
reset in interface Type
Throws:
DSETypeException - - If the type cannot be reset

reset

public void reset(Type newType)
           throws DSETypeException
Resets this type with a new Type instance.

Specified by:
reset in interface Type
Parameters:
newType - com.ibm.btt.base.types.DSEType
Throws:
DSETypeException - - If the type cannot be reset

setDefaultDescriptorForType

public void setDefaultDescriptorForType(PropertyDescription defaultDescriptor)
Sets the default PropertyDescriptor that defines this Type's business rules.

Specified by:
setDefaultDescriptorForType in interface Type
Parameters:
defaultDescriptor - PropertyDescription

setErrorMsgsDynaInfoEndDelim

public static void setErrorMsgsDynaInfoEndDelim(java.lang.String errorMsgDynaInfoEndDelimToSet)
Sets the errorMsgsDynaInfoEndDelim property.


setErrorMsgsDynaInfoStartDelim

public static void setErrorMsgsDynaInfoStartDelim(java.lang.String errorMsgDynStartDelimToSet)
Sets the errorMsgsDynaInfoStartDelim property.


setExternalizer

public static void setExternalizer(DSETypeExternalizer anExternalizer)
Sets the externalizer.

Parameters:
anExternalizer - DSETypeExternalizer

setKeyBuilder

public void setKeyBuilder(KeyBuilder keyBuilder)
Sets the KeyBuilder that builds Keys for this Type.

Specified by:
setKeyBuilder in interface Type
Parameters:
keyBuilder - KeyBuilder

setShareDescriptors

public static void setShareDescriptors(boolean newShareDescriptors)
Sets the shareDescriptor property.


getResTypes

public static java.util.ResourceBundle getResTypes()
Returns the resTypes.

Returns:
ResourceBundle

setResTypes

public static void setResTypes(java.util.ResourceBundle resTypes)
Sets the resTypes.

Parameters:
resTypes - - The resTypes to set

getResTypesExt

public static java.util.ResourceBundle getResTypesExt()
Returns the resTypesExt.

Returns:
ResourceBundle

setResTypesExt

public static void setResTypesExt(java.util.ResourceBundle resTypesExt)
Sets the resTypesExt.

Parameters:
resTypesExt - - The resTypesExt to set

getDescriptorNames

public java.util.List getDescriptorNames()

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011