IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format
Class AbstractFormatElement

java.lang.Object
  extended by com.ibm.btt.format.AbstractFormatElement
All Implemented Interfaces:
FormatElement
Direct Known Subclasses:
BaseDecorator, CompositeFormat, FieldFormat, FormatDefine, ReferenceFormat

public abstract class AbstractFormatElement
extends java.lang.Object
implements FormatElement


Field Summary
protected  java.lang.String dataName
           
protected  java.lang.String tagName
           
static java.lang.String TOSTRINGS_MARGIN
           
 
Constructor Summary
AbstractFormatElement()
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.String> attributes()
          Generic attributes method.
 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.
 java.lang.String getDataName()
          return the corresponding data element name to this IFormatElment.
 FormatElement rootDecorated()
          This method is not attended to be called by client code of FormatElement
 void setDataName(java.lang.String dataName)
           
 java.lang.String toString()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.btt.format.FormatElement
format, isContainer, unformat
 

Field Detail

TOSTRINGS_MARGIN

public static java.lang.String TOSTRINGS_MARGIN

dataName

protected java.lang.String dataName

tagName

protected java.lang.String tagName
Constructor Detail

AbstractFormatElement

public AbstractFormatElement()
Method Detail

getDataName

public java.lang.String getDataName()
Description copied from interface: FormatElement
return the corresponding data element name to this IFormatElment.

Specified by:
getDataName in interface FormatElement
Returns:

setDataName

public void setDataName(java.lang.String dataName)

extract

public Message[] extract(Message message)
                  throws ExtractException
Description copied from interface: FormatElement
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.

Specified by:
extract in interface FormatElement
Returns:
Throws:
ExtractException

rootDecorated

public FormatElement rootDecorated()
Description copied from interface: FormatElement
This method is not attended to be called by client code of FormatElement

Specified by:
rootDecorated in interface FormatElement
Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStrings

public java.util.List<java.lang.String> toStrings()
Description copied from interface: FormatElement
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.

Specified by:
toStrings in interface FormatElement
Returns:
List of Strings that represent the FormatElement.

attributes

protected java.util.Map<java.lang.String,java.lang.String> attributes()
Generic attributes method. This method parse throw the 'get' methods of the class, and finds out all the attributes of the bean. It is a simple implementation. Customers are recommended to override this method.

Returns:

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008