IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class BinaryIntegerStringFormat

java.lang.Object
  extended by com.ibm.btt.base.FormatElement
      extended by com.ibm.btt.base.FieldFormat
          extended by com.ibm.btt.base.IntegerFormat
              extended by com.ibm.btt.base.BinaryIntegerStringFormat
All Implemented Interfaces:
Cacheable, java.io.Externalizable, java.io.Serializable

@ATTR(value={"size#String#REQUIRED","signRule#Boolean#IMPLIED","byteOrdering#String#IMPLIED","unformattedSize#Integer#IMPLIED","padChar#String#IMPLIED"})
public class BinaryIntegerStringFormat
extends IntegerFormat

This class formats a numeric String as a byte representation of the Integer represented by this numeric String.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, externalizer, name
 
Constructor Summary
BinaryIntegerStringFormat()
          This constructor creates a BinaryIntegerStringFormat object.
BinaryIntegerStringFormat(java.lang.String aName)
          This constructor creates a new instance of the BinaryIntegerStringFormat class, which is obtained from the external definition files through aName.
 
Method Summary
 java.lang.String format(java.lang.String aString)
          Converts the String to a long format and calls the super long format.
 java.lang.String formatField(DataField aDataField)
          Provides access to the value of the DataField, converts it from a String to an Integer, and checks that it is in a valid long format.
 char getPadChar()
          Returns the value of padChar.
 int getUnformatStringSize()
          Returns the unformatStringSize.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a BinaryIntegerStringFormat with the attributes in aTag
 java.lang.String parseToString(java.lang.String aString)
          Interprets the input string, obtains the long value from the aString through the parent class, and converts the long value to a numeric string.
 void setPadChar(char aPadChar)
          Sets the value of padChar.
 void setUnformatStringSize(int aSize)
          Sets the value of unformatStringSize.
 java.lang.String toString()
          Converts the IntegerFormat to a String.
 DataField unformatField(java.lang.String aString, DataField aDataField)
          Updates the DataField value by interpreting the input string.
 
Methods inherited from class com.ibm.btt.base.IntegerFormat
extract, format, getByteOrdering, getSign, getSize, parse, setByteOrdering, setSign, setSize, unformat
 
Methods inherited from class com.ibm.btt.base.FieldFormat
format, format, toStrings, unformat, unformat
 
Methods inherited from class com.ibm.btt.base.FormatElement
checkIndexes, exceptionInfo, externalizer, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isItConstant, isNull, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BinaryIntegerStringFormat

public BinaryIntegerStringFormat()
This constructor creates a BinaryIntegerStringFormat object.


BinaryIntegerStringFormat

public BinaryIntegerStringFormat(java.lang.String aName)
                          throws java.io.IOException
This constructor creates a new instance of the BinaryIntegerStringFormat class, which is obtained from the external definition files through aName.

Parameters:
aName - java.lang.String
Throws:
java.io.IOException
Method Detail

format

public java.lang.String format(java.lang.String aString)
                        throws DSEInvalidArgumentException
Converts the String to a long format and calls the super long format.

Parameters:
aString - java.lang.String
Returns:
java.lang.String
Throws:
DSEInvalidArgumentException

formatField

public java.lang.String formatField(DataField aDataField)
                             throws DSEInvalidArgumentException
Provides access to the value of the DataField, converts it from a String to an Integer, and checks that it is in a valid long format. Delegates the long format to the super method long format.

Overrides:
formatField in class IntegerFormat
Parameters:
aDataField - DataField
Returns:
String
Throws:
DSEInvalidArgumentException

getPadChar

public char getPadChar()
Returns the value of padChar.

Returns:
char

getUnformatStringSize

public int getUnformatStringSize()
Returns the unformatStringSize.

Returns:
int

initializeFrom

public java.lang.Object initializeFrom(Tag aTag)
                                throws java.io.IOException
Initializes a BinaryIntegerStringFormat with the attributes in aTag

Overrides:
initializeFrom in class IntegerFormat
Parameters:
aTag - com.ibm.btt.base.Tag
Returns:
java.lang.Object
Throws:
java.io.IOException

parseToString

public java.lang.String parseToString(java.lang.String aString)
                               throws DSEInvalidArgumentException
Interprets the input string, obtains the long value from the aString through the parent class, and converts the long value to a numeric string. If required, it first adds the padChar to the left until it reaches the size indicated by the attribute unformatedStringSize (size of the unformatted string).

Parameters:
aString - java.lang.String
Returns:
java.lang.String
Throws:
DSEInvalidArgumentException

setPadChar

public void setPadChar(char aPadChar)
Sets the value of padChar.

Parameters:
aPadChar - char

setUnformatStringSize

public void setUnformatStringSize(int aSize)
Sets the value of unformatStringSize.

Parameters:
aSize - int

toString

public java.lang.String toString()
Converts the IntegerFormat to a String. Default values are not concatenated.

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

unformatField

public DataField unformatField(java.lang.String aString,
                               DataField aDataField)
                        throws DSEInvalidArgumentException
Updates the DataField value by interpreting the input string. Obtains the long value from aString through the parent class, converts the long to a numeric string, and updates the value of aDataField. If required, it first adds the padChar to the left until it reaches the size indicated by the attribute unformatedStringSize (size of the unformatted string).

Overrides:
unformatField in class IntegerFormat
Parameters:
aString - String
aDataField - DataField
Returns:
com.ibm.btt.base.DataField
Throws:
DSEInvalidArgumentException

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2010