IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format
Interface FormatElement

All Known Subinterfaces:
FormatDecorator
All Known Implementing Classes:
AbstractFormatElement, BaseDecorator, BinaryIntegerStringFormat, CompositeFormat, DateFormat, Delimiter, FieldFormat, FixedLength, FloatFormat, FormatDefine, HexDelimiter, IndexedFormat, IntegerFormat, JSONCommaDelimiter, JSONDecorator, JSONFormat, JSONNullCheckDecorator, JSONObjectFormat, MapRecordFormat, MaximumLength, NullCheckDecorator, NumericStringFormat, PackedDateFormat, PackedFormat, RecordFormat, ReferenceFormat, SelfLength, StringFormat, TimeFormat, XMLDecorator, XMLFormat

public interface FormatElement


Method Summary
 Message[] extract(Message message)
          Extracts (strips) the subMessage corresponding to the FormatElement from the input Message and returns it and the remaining Message as the elements of an array.
 Message format(ReadAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 java.lang.String getDataName()
          return the corresponding data element name to this IFormatElment.
 boolean isContainer()
          if true, this FormatElement has children. if false, this FormatElement has no children.
 FormatElement rootDecorated()
          This method is not attended to be called by client code of FormatElement
 java.util.List<java.lang.String> toStrings()
          This method is used to support AbstractFormatElement.toString() method
Client code of Formatter is not allowed to call it.
 void unformat(Message message, WriteAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 

Method Detail

getDataName

java.lang.String getDataName()
return the corresponding data element name to this IFormatElment.

Returns:

isContainer

boolean isContainer()
if true, this FormatElement has children. if false, this FormatElement has no children.

For example:
com.ibm.btt.format.CompositeFormat and its sub class will always return true;
com.ibm.btt.format.FiledFormat and its sub class will always return false;
com.ibm.btt.format.FormatDecorator and its subclass will delegate this method to its decorated FormatElement.

Returns:

extract

Message[] extract(Message message)
                  throws ExtractException
Extracts (strips) the subMessage corresponding to the FormatElement from the input Message and returns it and the remaining Message as the elements of an array.
The returned array of Message should always contain two elements.

Take Message 1FCD2639FE for example. The returned array of Message may be {1FCD, 2639FE}, the first element 1FCD is the Message required by this FormatElement, while the second element 2639FE is the remaining Message.

This method is not attended to be called by client code of FormatElement
This method is called by the unformat() method of the composite formats such as com.ibm.btt.format.impl.RecordFormat and com.ibm.btt.format.impl.IndexedFormat.

Parameters:
message -
Returns:
Throws:
ExtractException

format

Message format(ReadAdapter dataAdapter)
               throws FormatException
This method is attended to be called by client code of FormatElement

Parameters:
dataAdapter -
Returns:
Throws:
FormatException

unformat

void unformat(Message message,
              WriteAdapter dataAdapter)
              throws UnformatException
This method is attended to be called by client code of FormatElement

Parameters:
message -
dataAdapter -
Throws:
UnformatException

rootDecorated

FormatElement rootDecorated()
This method is not attended to be called by client code of FormatElement

Returns:

toStrings

java.util.List<java.lang.String> toStrings()
This method is used to support AbstractFormatElement.toString() method
Client code of Formatter is not allowed to call it.
But subclasses of AbstractFormatElement are allowed to override this method to customize its toString() method.

Returns:
List of Strings that represent the FormatElement.

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008