IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class DynamicRecordFormat

java.lang.Object
  extended by com.ibm.btt.base.FormatElement
      extended by com.ibm.btt.base.KeyedCollectionFormat
          extended by com.ibm.btt.base.RecordFormat
              extended by com.ibm.btt.base.DynamicRecordFormat
All Implemented Interfaces:
Cacheable, java.io.Externalizable, java.io.Serializable

@ATTR(value="emptyKeyedCollection#Boolean#IMPLIED")
public class DynamicRecordFormat
extends RecordFormat

The DynamicRecordFormat class implements a dynamic format for records. It is used to unformat a formatted string into a context or a KeyedCollection when some of the required DataElements do not exist. They are dynamically created.

See Also:
Serialized Form

Field Summary
(package private)  int currentSize
           
 
Fields inherited from class com.ibm.btt.base.KeyedCollectionFormat
dataElementEmpty, elements
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, externalizer, name, xmlSupport
 
Constructor Summary
DynamicRecordFormat()
          This constructor creates a DynamicRecordFormat object.
DynamicRecordFormat(java.lang.String aName)
          This constructor creates a DynamicRecordFormat object with name aName.
 
Method Summary
protected  void addElementFromFormat(java.lang.String aPath, FormatElement aFormatElement, KeyedCollection aKeyedCollection)
          Extracts the description of an Element from aFormatElement and calls the method setValueAt to add the DataElement to the aKeyedCollection collection.
protected  java.lang.Object obtainDataElement(FormatElement aFormatElement, Context aContext)
          Looks for the element which will format aFormatElement.
protected  DataElement obtainDataElement(FormatElement aFormatElement, KeyedCollection aKeyedCollection)
          Looks for the element which will format aFormatElement.
 int unformat(int ndxFrom, int ndxTo, java.lang.String str, Context ctx)
          Returns a data element by unformatting the KeyedCollection using the ctx passed as a parameter.
 int unformat(int ndxFrom, int ndxTo, java.lang.String aString, DataElement de)
          Returns int by unformatting the KeyedCollection using the data element passed as a parameter.
 int unformatContext(int ndxFrom, int ndxTo, java.lang.String aString, Context aContext)
          Performs the unformat by looking for the elements to format around the context tree of the aContext passed as a parameter.
 DataElement unformatContext(java.lang.String aString, Context aContext)
          Performs the unformat by looking for the elements to format around the context tree of the context passed as a parameter.
 int unformatKeyedCollection(int ndxFrom, int ndxTo, java.lang.String aString, KeyedCollection kc)
          Performs the unformat by looking for the elements to format around the kc passed as a parameter.
 KeyedCollection unformatKeyedCollection(java.lang.String aString, KeyedCollection aKeyedCollection)
          Performs the unformat by looking for the elements to format around the keyedCollection passed as a parameter.
 
Methods inherited from class com.ibm.btt.base.RecordFormat
extract, formatContext, formatKeyedCollection, initializeFrom, toString, toStrings
 
Methods inherited from class com.ibm.btt.base.KeyedCollectionFormat
add, addElementAt, addFirst, at, checkIndexes, format, format, getDataElementEmpty, getElements, getEnumeration, reinitialize, removeAll, removeAt, setElements, size, unformat, unformat
 
Methods inherited from class com.ibm.btt.base.FormatElement
exceptionInfo, externalizer, getAttributeValueForXMLFormat, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, isNull, readExternal, readExternal, readObject, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toTags, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentSize

int currentSize
Constructor Detail

DynamicRecordFormat

public DynamicRecordFormat()
This constructor creates a DynamicRecordFormat object.


DynamicRecordFormat

public DynamicRecordFormat(java.lang.String aName)
                    throws java.io.IOException
This constructor creates a DynamicRecordFormat object with name aName.

Parameters:
aName - java.lang.String
Throws:
java.io.IOException.
java.io.IOException
Method Detail

addElementFromFormat

protected void addElementFromFormat(java.lang.String aPath,
                                    FormatElement aFormatElement,
                                    KeyedCollection aKeyedCollection)
                             throws DSEObjectNotFoundException,
                                    DSEInvalidArgumentException
Extracts the description of an Element from aFormatElement and calls the method setValueAt to add the DataElement to the aKeyedCollection collection.

Parameters:
aPath - java.lang.String
aFormatElement - FormatElement
aKeyedCollection - KeyedCollection
Throws:
DSEObjectNotFoundException
DSEInvalidArgumentException

obtainDataElement

protected java.lang.Object obtainDataElement(FormatElement aFormatElement,
                                             Context aContext)
                                      throws DSEInvalidRequestException
Looks for the element which will format aFormatElement.

Overrides:
obtainDataElement in class RecordFormat
Parameters:
aFormatElement - com.ibm.btt.base.FormatElement
aContext - com.ibm.btt.base.Context
Returns:
java.lang.Object
Throws:
com.ibm.btt.base.DSEInvalidRequestException.
DSEInvalidRequestException

obtainDataElement

protected DataElement obtainDataElement(FormatElement aFormatElement,
                                        KeyedCollection aKeyedCollection)
                                 throws DSEInvalidRequestException
Looks for the element which will format aFormatElement.

Overrides:
obtainDataElement in class RecordFormat
Parameters:
aFormatElement - com.ibm.btt.base.FormatElement
aKeyedCollection - com.ibm.btt.base.KeyedCollection
Returns:
com.ibm.btt.base.DataElement
Throws:
DSEInvalidRequestException

unformatContext

public DataElement unformatContext(java.lang.String aString,
                                   Context aContext)
                            throws DSEInvalidRequestException,
                                   DSEInvalidArgumentException
Performs the unformat by looking for the elements to format around the context tree of the context passed as a parameter. If some of the DataElements don't exist, they will be created.

Overrides:
unformatContext in class RecordFormat
Parameters:
aString - java.lang.String
aContext - com.ibm.btt.base.Context
Returns:
com.ibm.btt.base.DataElement
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformatKeyedCollection

public KeyedCollection unformatKeyedCollection(java.lang.String aString,
                                               KeyedCollection aKeyedCollection)
                                        throws DSEInvalidRequestException,
                                               DSEInvalidArgumentException
Performs the unformat by looking for the elements to format around the keyedCollection passed as a parameter. If some of the DataElements don't exist, they will be created.

Overrides:
unformatKeyedCollection in class RecordFormat
Parameters:
aString - java.lang.String
aKeyedCollection - com.ibm.btt.base.KeyedCollection
Returns:
com.ibm.btt.base.KeyedCollection
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String aString,
                    DataElement de)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
Returns int by unformatting the KeyedCollection using the data element passed as a parameter. If the data element is not a KeyedCollection, the method throws an Exception.

Overrides:
unformat in class RecordFormat
Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
aString - String
de - DataElement
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String str,
                    Context ctx)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
Returns a data element by unformatting the KeyedCollection using the ctx passed as a parameter.

Overrides:
unformat in class RecordFormat
Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
str - java.lang.String
ctx - com.ibm.btt.base.Context
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformatKeyedCollection

public int unformatKeyedCollection(int ndxFrom,
                                   int ndxTo,
                                   java.lang.String aString,
                                   KeyedCollection kc)
                            throws DSEInvalidRequestException,
                                   DSEInvalidArgumentException
Performs the unformat by looking for the elements to format around the kc passed as a parameter. If some of the DataElements don't exist, they will be created.

Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
aString - java.lang.String
kc - com.ibm.btt.base.KeyedCollection
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformatContext

public int unformatContext(int ndxFrom,
                           int ndxTo,
                           java.lang.String aString,
                           Context aContext)
                    throws DSEInvalidRequestException,
                           DSEInvalidArgumentException
Performs the unformat by looking for the elements to format around the context tree of the aContext passed as a parameter. If some of the DataElements don't exist, they will be created.

Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
aString - java.lang.String
aContext - com.ibm.btt.base.Context
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011