com.ibm.dse.base
Class DynamicRecordFormat

java.lang.Object
  |
  +--com.ibm.dse.base.FormatElement
        |
        +--com.ibm.dse.base.KeyedCollectionFormat
              |
              +--com.ibm.dse.base.RecordFormat
                    |
                    +--com.ibm.dse.base.DynamicRecordFormat

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

Fields inherited from class com.ibm.dse.base.FormatElement
dataElementName, 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
 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.dse.base.RecordFormat
extract, formatContext, formatKeyedCollection, initializeFrom, toString, toStrings
 
Methods inherited from class com.ibm.dse.base.KeyedCollectionFormat
add, addElementAt, addFirst, at, format, format, getElements, getEnumeration, removeAll, removeAt, setElements, size, unformat, unformat
 
Methods inherited from class com.ibm.dse.base.FormatElement
exceptionInfo, externalizer, format, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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. -  
Method Detail

addElementFromFormat

public 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.dse.base.FormatElement
aContext - com.ibm.dse.base.Context
Returns:
java.lang.Object
Throws:
com.ibm.dse.base.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.dse.base.FormatElement
aKeyedCollection - com.ibm.dse.base.KeyedCollection
Returns:
com.ibm.dse.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.dse.base.Context
Returns:
com.ibm.dse.base.DataElement

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.dse.base.KeyedCollection
Returns:
com.ibm.dse.base.KeyedCollection