IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format.impl
Class IndexedFormat

java.lang.Object
  extended by com.ibm.btt.format.AbstractFormatElement
      extended by com.ibm.btt.format.CompositeFormat
          extended by com.ibm.btt.format.impl.IndexedFormat
All Implemented Interfaces:
FormatElement

public class IndexedFormat
extends CompositeFormat


Field Summary
 
Fields inherited from class com.ibm.btt.format.CompositeFormat
children
 
Fields inherited from class com.ibm.btt.format.AbstractFormatElement
dataName, tagName, TOSTRINGS_MARGIN
 
Constructor Summary
IndexedFormat()
           
 
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.
 Message format(ReadAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 int getAppend()
           
 FormatElement getElement()
           
 java.lang.String getElementType()
           
 int getTimes()
           
 boolean isContainer()
          if true, this FormatElement has children. if false, this FormatElement has no children.
 void setAppend(java.lang.String append)
           
 void setElementType(java.lang.String elementType)
           
 void setTimes(java.lang.String times)
           
 void unformat(Message bytes, WriteAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 
Methods inherited from class com.ibm.btt.format.CompositeFormat
addChild, getChildren, toStrings
 
Methods inherited from class com.ibm.btt.format.AbstractFormatElement
getDataName, rootDecorated, setDataName, toString
 
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
getDataName, rootDecorated
 

Constructor Detail

IndexedFormat

public IndexedFormat()
Method Detail

getElementType

public java.lang.String getElementType()
Returns:
the elementType

setElementType

public void setElementType(java.lang.String elementType)
Parameters:
elementType - the elementType to set

getAppend

public int getAppend()
Returns:
the append

setAppend

public void setAppend(java.lang.String append)
Parameters:
append - the append to set

getTimes

public int getTimes()
Returns:
the times

setTimes

public void setTimes(java.lang.String times)
Parameters:
times - the times to set

getElement

public FormatElement getElement()

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
Overrides:
extract in class AbstractFormatElement
Returns:
Throws:
ExtractException

format

public Message format(ReadAdapter dataAdapter)
               throws FormatException
Description copied from interface: FormatElement
This method is attended to be called by client code of FormatElement

Returns:
Throws:
FormatException

isContainer

public boolean isContainer()
Description copied from interface: FormatElement
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.

Specified by:
isContainer in interface FormatElement
Overrides:
isContainer in class CompositeFormat
Returns:

unformat

public void unformat(Message bytes,
                     WriteAdapter dataAdapter)
              throws UnformatException
Description copied from interface: FormatElement
This method is attended to be called by client code of FormatElement

Throws:
UnformatException

attributes

protected java.util.Map<java.lang.String,java.lang.String> attributes()
Description copied from class: AbstractFormatElement
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.

Overrides:
attributes in class AbstractFormatElement
Returns:

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008