IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class ConstantFormat

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

@EXTEND(value="NOT")
@ATTR(value="value#String#REQUIRED")
public class ConstantFormat
extends FormatElement

This class returns a constant value when it is formatted, and extracts the same constant value when it is unformatted.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.String constantValue
           
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, externalizer, name, xmlSupport
 
Constructor Summary
ConstantFormat()
          This constructor creates a ConstantFormat object.
ConstantFormat(java.lang.String aName)
          This constructor creates a new instance of the ConstantFormat class, which is obtained from the external definition files through aName.
 
Method Summary
 java.lang.String[] extract(java.lang.String aString)
          Extracts the length that is equal to the constantValue length.
 java.lang.String format(DataElement aDataElement)
          Returns the constantValue.
 java.lang.String getConstantValue()
          Gets the constantValue property (java.lang.String) value.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a ConstantFormat with the aTag attributes.
 boolean isItConstant()
          Returns true.
 void setConstantValue(java.lang.String aConstantValue)
          Sets the constantValue property (java.lang.String) value.
 java.lang.String toString()
          Returns a visual representation of the instance.
 Vector toStrings()
          Returns a visual representation of this format element.
 int unformat(int ndxFrom, int ndxTo, java.lang.String str, Context aDataElement)
          Get the next index
 int unformat(int ndxFrom, int ndxTo, java.lang.String str, DataElement aDataElement)
          Get the next index
 DataElement unformat(java.lang.String aString, DataElement aDataElement)
          Verifies that the String is equal to the constantValue and, if it is not, it throws an Exception.
 
Methods inherited from class com.ibm.btt.base.FormatElement
checkIndexes, exceptionInfo, externalizer, format, getAttributeValueForXMLFormat, getDataElementName, getExternalizer, getName, getTagName, isCacheable, isConstant, isNull, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

constantValue

java.lang.String constantValue
Constructor Detail

ConstantFormat

public ConstantFormat()
This constructor creates a ConstantFormat object.


ConstantFormat

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

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

extract

public java.lang.String[] extract(java.lang.String aString)
Extracts the length that is equal to the constantValue length.

Overrides:
extract in class FormatElement
Parameters:
aString - String
Returns:
String[]

format

public java.lang.String format(DataElement aDataElement)
Returns the constantValue.

Specified by:
format in class FormatElement
Parameters:
aDataElement - DataElement
Returns:
String

getConstantValue

public java.lang.String getConstantValue()
Gets the constantValue property (java.lang.String) value.

Returns:
- The constantValue value
See Also:
setConstantValue(java.lang.String)

initializeFrom

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

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

isItConstant

public boolean isItConstant()
Returns true.

Overrides:
isItConstant in class FormatElement
Returns:
Boolean

setConstantValue

public void setConstantValue(java.lang.String aConstantValue)
Sets the constantValue property (java.lang.String) value.

Parameters:
aConstantValue - - The new value for the property
See Also:
getConstantValue()

toString

public java.lang.String toString()
Returns a visual representation of the instance.

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

toStrings

public Vector toStrings()
Returns a visual representation of this format element.

Overrides:
toStrings in class FormatElement
Returns:
com.ibm.btt.base.Vector

unformat

public DataElement unformat(java.lang.String aString,
                            DataElement aDataElement)
                     throws DSEInvalidArgumentException
Verifies that the String is equal to the constantValue and, if it is not, it throws an Exception.

Specified by:
unformat in class FormatElement
Throws:
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String str,
                    DataElement aDataElement)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
Get the next index

Overrides:
unformat in class FormatElement
Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
str - - the string will be unformated
aDataElement - - the dataelement
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String str,
                    Context aDataElement)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
Get the next index

Overrides:
unformat in class FormatElement
Parameters:
ndxFrom - - the initial index
ndxTo - - the final index
str - - the string will be unformated
aDataElement - - the context
Returns:
int
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011