IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format.impl
Class FormatAdapter

java.lang.Object
  extended by com.ibm.btt.base.FormatElement
      extended by com.ibm.btt.format.impl.FormatAdapter
All Implemented Interfaces:
Cacheable, java.io.Externalizable, java.io.Serializable

public class FormatAdapter
extends FormatElement

This FormatElement subclasses from com.ibm.btt.base.FormatElement. It is used as a Interface Adapter from com.ibm.btt.format.FormatElement to com.ibm.btt.base.FormatElement. With this class, we keep the other BTT components (such as operation, processor, channel and CSM) unchanged, and can switch to use new Formatter or old Formatter.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, name
 
Constructor Summary
FormatAdapter()
           
 
Method Summary
 java.lang.String[] extract(java.lang.String aString)
          Extracts (strips) the substring corresponding to the format element from the input String and returns it and the remaining String as the elements of an array.
 java.lang.String format(Context aContext)
          Throws an Exception.
 java.lang.String format(DataElement aDataElement)
          Format abstract class.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a FormatElement with the Tag attributes.
 java.lang.Boolean isConstant()
          Returns false.
 boolean isItConstant()
          Returns false.
 java.lang.String toString()
          Returns a visual representation of this format element.
 DataElement unformat(java.lang.String aString, Context aContext)
          Throws an Exception.
 DataElement unformat(java.lang.String aString, DataElement aDataElement)
          Unformat abstract method.
 
Methods inherited from class com.ibm.btt.base.FormatElement
checkIndexes, exceptionInfo, externalizer, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isNull, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toStrings, toTags, unformat, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormatAdapter

public FormatAdapter()
Method Detail

format

public java.lang.String format(DataElement aDataElement)
                        throws DSEInvalidClassException,
                               DSEInvalidRequestException,
                               DSEInvalidArgumentException
Description copied from class: FormatElement
Format abstract class.

Specified by:
format in class FormatElement
Parameters:
aDataElement - DataElement
Returns:
String
Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException,
                                       DSEException
Description copied from class: FormatElement
Initializes a FormatElement with the Tag attributes.

Specified by:
initializeFrom in class FormatElement
Parameters:
aTag - com.ibm.btt.base.Tag
Throws:
java.io.IOException
DSEException

unformat

public DataElement unformat(java.lang.String aString,
                            DataElement aDataElement)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException
Description copied from class: FormatElement
Unformat abstract method. To be implemented by the subclasses.

Specified by:
unformat in class FormatElement
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

extract

public java.lang.String[] extract(java.lang.String aString)
                           throws DSEInvalidArgumentException
Description copied from class: FormatElement
Extracts (strips) the substring corresponding to the format element from the input String and returns it and the remaining String as the elements of an array. This method is called by the unformat() method of the collections formats such as RecordFormat and IndexedCollectionFormat. The default behavior is to accept the whole input String.

Overrides:
extract in class FormatElement
Parameters:
aString - String
Returns:
String[]
Throws:
DSEInvalidArgumentException

format

public java.lang.String format(Context aContext)
                        throws DSEInvalidClassException,
                               DSEInvalidRequestException,
                               DSEInvalidArgumentException
Description copied from class: FormatElement
Throws an Exception. Only KeyedCollectionFormats can format a Context. This method is implemented for polymorphism.

Overrides:
format in class FormatElement
Parameters:
aContext - com.ibm.btt.base.Context
Returns:
java.lang.String
Throws:
DSEInvalidClassException
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public DataElement unformat(java.lang.String aString,
                            Context aContext)
                     throws DSEInvalidRequestException,
                            DSEInvalidArgumentException
Description copied from class: FormatElement
Throws an Exception. Only KeyedCollectionFormats can unformat a Context. This method is implemented for polymorphism.

Overrides:
unformat in class FormatElement
aContext - com.ibm.btt.base.Context
Returns:
com.ibm.btt.base.DataElement
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

isConstant

public java.lang.Boolean isConstant()
Description copied from class: FormatElement
Returns false. It is not a constant. It is recommended to use boolean isItConstant() instead of this method.

Overrides:
isConstant in class FormatElement
Returns:
Boolean

isItConstant

public boolean isItConstant()
Description copied from class: FormatElement
Returns false. It is not a constant.

Overrides:
isItConstant in class FormatElement
Returns:
Boolean

toString

public java.lang.String toString()
Description copied from class: FormatElement
Returns a visual representation of this format element.

Overrides:
toString in class FormatElement
Returns:
java.lang.String

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008