IBM Bank Transformation Toolkit Javadoc

com.ibm.btt.format.impl
Class ReferenceFormat

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

public class ReferenceFormat
extends AbstractFormatElement


Field Summary
protected  FormatElement refFormat
           
protected  java.lang.String refId
           
 
Fields inherited from class com.ibm.btt.format.AbstractFormatElement
dataName, tagName, TOSTRINGS_MARGIN
 
Constructor Summary
ReferenceFormat()
           
 
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 getRefId()
           
 boolean isContainer()
          if true, this FormatElement has children. if false, this FormatElement has no children.
 void setRefId(java.lang.String refId)
           
 void unformat(Message message, WriteAdapter dataAdapter)
          This method is attended to be called by client code of FormatElement
 
Methods inherited from class com.ibm.btt.format.AbstractFormatElement
attributes, getDataName, rootDecorated, setDataName, toString, toStrings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

refId

protected java.lang.String refId

refFormat

protected FormatElement refFormat
Constructor Detail

ReferenceFormat

public ReferenceFormat()
Method Detail

getRefId

public java.lang.String getRefId()

setRefId

public void setRefId(java.lang.String refId)

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.

Returns:

unformat

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

Throws:
UnformatException

IBM Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2008