IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base
Class DateFormat

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

@ATTR(value={"ordering#String#IMPLIED","fourDigYear#Boolean#IMPLIED","sep#String#IMPLIED","useSep#Boolean#IMPLIED"})
public class DateFormat
extends FieldFormat

This class formats a Date to a String following the conditions of its attributes.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ibm.btt.base.FormatElement
dataElementName, externalizer, name
 
Constructor Summary
DateFormat()
          This constructor creates a DateFormat object.
DateFormat(java.lang.String aName)
          This constructor creates the DateFormat object with the id aName.
 
Method Summary
 java.lang.String[] extract(java.lang.String aString)
          Extracts a string the length of which is the length of the expected string.
 java.lang.String formatField(DataField aDataField)
          Formats a Date using the java.text.SimpleDatFormat class initialized with the declared parameters.
 boolean getFourDigitYear()
          Returns the value of fourDigitYear.
 int getOrdering()
          Returns the value of ordering.
 java.lang.String getPattern()
          Calculates the pattern that is used to initialize the SimpleDateFormat.
 java.lang.String getSeparator()
          Returns the value of separator.
 boolean getUseSeparator()
          Returns the value of useSeparator.
 java.lang.Object initializeFrom(Tag aTag)
          Initializes a DateFormat with the Tag attributes.
 void setFourDigitYear(boolean aBoolean)
          Sets the value of fourDigitYear.
 void setOrdering(int anInt)
          Sets the value of ordering.
 void setSeparator(java.lang.String aSeparator)
          Sets the value of separator.
 void setUseSeparator(boolean aBoolean)
          Sets the value of useSeparator.
 java.lang.String toString()
          Returns an XML representation of this instance.
 int unformat(int ndxFrom, int ndxTo, java.lang.String str, DataElement aDataElement)
          The new unformat methods added to the FormatElement to minimize the instances created during the unfomat process that later will be collected by the garbage collector (GC).
 DataField unformatField(java.lang.String aString, DataField aDataField)
          Unformats aString using the parse() method of java.text.SimpleDataFormat initialize using the parameters.
 
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, setSize, toTags, unformat, writeExternal, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DateFormat

public DateFormat()
This constructor creates a DateFormat object.


DateFormat

public DateFormat(java.lang.String aName)
           throws java.io.IOException
This constructor creates the DateFormat object with the id aName.

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

extract

public java.lang.String[] extract(java.lang.String aString)
Extracts a string the length of which is the length of the expected string.

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

formatField

public java.lang.String formatField(DataField aDataField)
                             throws DSEInvalidClassException
Formats a Date using the java.text.SimpleDatFormat class initialized with the declared parameters.

Specified by:
formatField in class FieldFormat
Throws:
DSEInvalidClassException

getFourDigitYear

public boolean getFourDigitYear()
Returns the value of fourDigitYear.

Returns:
boolean

getOrdering

public int getOrdering()
Returns the value of ordering.

Returns:
int

getPattern

public java.lang.String getPattern()
Calculates the pattern that is used to initialize the SimpleDateFormat. It is calculated from the parameters of the class.

Returns:
java.lang.String

getSeparator

public java.lang.String getSeparator()
Returns the value of separator.

Returns:
java.lang.String

getUseSeparator

public boolean getUseSeparator()
Returns the value of useSeparator.

Returns:
boolean

initializeFrom

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

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

setFourDigitYear

public void setFourDigitYear(boolean aBoolean)
Sets the value of fourDigitYear.

Parameters:
aBoolean - boolean

setOrdering

public void setOrdering(int anInt)
Sets the value of ordering.

Parameters:
anInt - int

setSeparator

public void setSeparator(java.lang.String aSeparator)
Sets the value of separator.

Parameters:
aSeparator - java.lang.String

setUseSeparator

public void setUseSeparator(boolean aBoolean)
Sets the value of useSeparator.

Parameters:
aBoolean - boolean

toString

public java.lang.String toString()
Returns an XML representation of this instance.

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

unformatField

public DataField unformatField(java.lang.String aString,
                               DataField aDataField)
                        throws DSEInvalidArgumentException
Unformats aString using the parse() method of java.text.SimpleDataFormat initialize using the parameters.

Specified by:
unformatField in class FieldFormat
Throws:
DSEInvalidArgumentException

unformat

public int unformat(int ndxFrom,
                    int ndxTo,
                    java.lang.String str,
                    DataElement aDataElement)
             throws DSEInvalidRequestException,
                    DSEInvalidArgumentException
The new unformat methods added to the FormatElement to minimize the instances created during the unfomat process that later will be collected by the garbage collector (GC).

Overrides:
unformat in class FieldFormat
Parameters:
ndxFrom - is the initial index
ndxTo - one is the final index
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009