com.ibm.dse.base
Class ConstantFormat

java.lang.Object
  |
  +--com.ibm.dse.base.FormatElement
        |
        +--com.ibm.dse.base.ConstantFormat
Direct Known Subclasses:
FormsConstantFormat

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

Fields inherited from class com.ibm.dse.base.FormatElement
dataElementName, name
 
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.
 java.lang.Boolean isConstant()
          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.
 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.dse.base.FormatElement
exceptionInfo, externalizer, format, format, getDataElementName, getExternalizer, getName, getTagName, isCacheable, readExternal, readExternal, readObject, reinitialize, removeExternal, rootDecorated, setDataElementName, setExternalizer, setName, setSize, toStrings, toTags, unformat, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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
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
Tags copied from class: FormatElement
Parameters:
String - aString
Returns:
String[]

format

public java.lang.String format(DataElement aDataElement)
Returns the constantValue.
Overrides:
format in class FormatElement
Tags copied from 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.
Overrides:
initializeFrom in class FormatElement
Parameters:
aTag - com.ibm.dse.base.Tag
Returns:
java.lang.Object

isConstant

public java.lang.Boolean isConstant()
Returns true.
Overrides:
isConstant in class FormatElement
Tags copied from class: FormatElement
Returns:
Boolean

setConstantValue

public void setConstantValue(java.lang.String aConstantValue)
Sets the constantValue property (java.lang.String) value.
Parameters:
constantValue - 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

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.
Overrides:
unformat in class FormatElement