IBM Branch Transformation Toolkit Javadoc

com.ibm.btt.base
Class DynamicRecordFormat

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

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
 
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.
 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.
 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, format, format, getDataElementEmpty, getElements, getEnumeration, reinitialize, removeAll, removeAt, setElements, size, unformat, unformat
 
Methods inherited from class com.ibm.btt.base.FormatElement
exceptionInfo, externalizer, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, 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

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005