IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base.types.ext
Class TimeConverter

java.lang.Object
  extended by com.ibm.btt.base.types.AbstractConverter
      extended by com.ibm.btt.base.types.ext.TimeConverter
All Implemented Interfaces:
Conversion, TypeConstants, java.io.Externalizable, java.io.Serializable

public class TimeConverter
extends AbstractConverter

This is the converter for business objects of the Date type.

See Also:
Serialized Form

Field Summary
(package private)  java.lang.String amString
           
(package private)  boolean hours24
           
(package private)  java.lang.String mask
           
(package private)  java.lang.String pmString
           
 
Fields inherited from class com.ibm.btt.base.types.AbstractConverter
keyValuePairs
 
Fields inherited from interface com.ibm.btt.base.types.TypeConstants
amended, CONV_TYPE_DEFAULT, CONV_TYPE_HOST, CONV_TYPE_OUTPUT, CONV_TYPE_SER, CONV_TYPE_XML, disabled, hidden, isAmended, isDisabled, isHidden, isMandatory, isOmitted, isReadOnly, mandatory, omitted, readOnly, TYPE_DEFAULT, TYPE_REGISTRY_INIT_SIZE
 
Constructor Summary
TimeConverter()
          Creates a TimeConverter object.
TimeConverter(java.lang.String[] supportedConversionTypes, java.util.Hashtable keyValuePairs)
          Creates a TimeConverter object.
 
Method Summary
 java.lang.Object convertTo(java.lang.Object obj, java.lang.String convType, PropertyDescription pd, boolean byReference, java.util.Locale locale, Hashtable parameters)
          Converts an input object into a proper object handled by the invoker.
 void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor, Hashtable parameters)
          Formats the Object using the specified conversion type and writer passed as arguments.
 void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor, java.util.Locale locale, Hashtable parameters)
          Formats the Object using the specified conversion type, locale, and writer passed as arguments.
 java.lang.String getMask()
          Returns the value of the mask attribute.
 void setAmString(java.lang.String anAmString)
          Sets the value of the amString attribute.
 void setHours24(boolean anHours24)
          Sets the value of the hours24 attribute.
 void setMask(java.lang.String dateMask)
          Sets the value of the mask attribute.
 void setPmString(java.lang.String aPmString)
          Sets the value of the pmString attribute.
protected  java.lang.Object unformat(java.lang.String dateAsString, java.lang.String convType, PropertyDescription descriptor, java.util.Locale locale)
          Converts a String representing a Date into another Date.
protected  java.lang.Object unformat(java.lang.String dateAsString, java.lang.String convType, PropertyDescription descriptor, java.util.Locale locale, Hashtable parameters)
          Converts a String representing a Date into another Date.
 java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, Hashtable parameters)
          Converts the stream into an Object using the appropriate conversion type.
 java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, java.util.Locale locale, Hashtable parameters)
          Uses the reader to construct an Object of the correct type using the appropriate conversion type and locale.
 void validateParams(PropertyDescription pd)
          Validates the externally defined parameters for this converter.
 
Methods inherited from class com.ibm.btt.base.types.AbstractConverter
convertFrom, convertFrom, convertFrom, convertFrom, convertFrom, convertTo, convertTo, convertTo, convertTo, formatToWriter, formatToWriter, formatToWriter, formatToWriterForType, formatToWriterForType, getParameters, getSupportedConversionTypes, readExternal, supportsConversionType, unformatFromReader, unformatFromReader, unformatFromReader, unformatFromReader, unformatFromReaderForType, unformatFromReaderForType, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

amString

java.lang.String amString

pmString

java.lang.String pmString

hours24

boolean hours24

mask

java.lang.String mask
Constructor Detail

TimeConverter

public TimeConverter()
              throws DSETypeException
Creates a TimeConverter object.

Throws:
DSETypeException - - If the supportedConversionTypes parameter passed to the superclass is null or empty

TimeConverter

public TimeConverter(java.lang.String[] supportedConversionTypes,
                     java.util.Hashtable keyValuePairs)
              throws DSETypeException
Creates a TimeConverter object.

Parameters:
supportedConversionTypes - java.lang.String[]
keyValuePairs - java.util.Hashtable
Throws:
DSETypeException - - If the supportedConversionTypes parameter passed to the superclass is null or empty
Method Detail

convertTo

public java.lang.Object convertTo(java.lang.Object obj,
                                  java.lang.String convType,
                                  PropertyDescription pd,
                                  boolean byReference,
                                  java.util.Locale locale,
                                  Hashtable parameters)
                           throws DSETypeException
Converts an input object into a proper object handled by the invoker. The invoker can use the output object for different purposes and the type of the object is dependent on the converter. If the byReference parameter is set to true, the conversion, if accepted by the converter, is performed by reference.

Specified by:
convertTo in interface Conversion
Overrides:
convertTo in class AbstractConverter
Parameters:
obj - java.lang.Object
convType - java.lang.String
pd - com.ibm.btt.base.types.PropertyDescription
byReference - boolean
locale - Locale
parameters - com.ibm.btt.base.Hastable
Returns:
java.lang.Object
Throws:
DSETypeException

formatToWriterForType

public void formatToWriterForType(java.lang.Object value,
                                  java.lang.String conversionType,
                                  java.io.Writer writer,
                                  PropertyDescription descriptor,
                                  Hashtable parameters)
                           throws java.io.IOException,
                                  DSETypeException
Formats the Object using the specified conversion type and writer passed as arguments.

Overrides:
formatToWriterForType in class AbstractConverter
Parameters:
value - Object
conversionType - String
writer - Writer
descriptor - PropertyDescriptor
parameters - com.ibm.btt.base.Hashtable
Throws:
java.io.IOException - - If an I/O error occurs
DSETypeException

formatToWriterForType

public void formatToWriterForType(java.lang.Object value,
                                  java.lang.String conversionType,
                                  java.io.Writer writer,
                                  PropertyDescription descriptor,
                                  java.util.Locale locale,
                                  Hashtable parameters)
                           throws java.io.IOException
Formats the Object using the specified conversion type, locale, and writer passed as arguments.

Overrides:
formatToWriterForType in class AbstractConverter
Parameters:
value - Object
writer - Writer
descriptor - PropertyDescriptor
locale - Locale
parameters - com.ibm.btt.base.Hashtable
conversionType - String
Throws:
java.io.IOException - - If an I/O error occurs

getMask

public java.lang.String getMask()
Returns the value of the mask attribute.

Returns:
java.lang.String

setAmString

public void setAmString(java.lang.String anAmString)
Sets the value of the amString attribute.

Parameters:
anAmString - java.lang.String

setHours24

public void setHours24(boolean anHours24)
Sets the value of the hours24 attribute.

Parameters:
anHours24 - boolean

setMask

public void setMask(java.lang.String dateMask)
Sets the value of the mask attribute.

Parameters:
dateMask - java.lang.String

setPmString

public void setPmString(java.lang.String aPmString)
Sets the value of the pmString attribute.

Parameters:
aPmString - java.lang.String

unformat

protected java.lang.Object unformat(java.lang.String dateAsString,
                                    java.lang.String convType,
                                    PropertyDescription descriptor,
                                    java.util.Locale locale)
                             throws DSETypeException
Converts a String representing a Date into another Date.

Overrides:
unformat in class AbstractConverter
Returns:
java.lang.Object
Throws:
DSETypeException

unformat

protected java.lang.Object unformat(java.lang.String dateAsString,
                                    java.lang.String convType,
                                    PropertyDescription descriptor,
                                    java.util.Locale locale,
                                    Hashtable parameters)
                             throws DSETypeException
Converts a String representing a Date into another Date.

Overrides:
unformat in class AbstractConverter
Returns:
java.lang.Object
Throws:
DSETypeException

unformatFromReaderForType

public java.lang.Object unformatFromReaderForType(java.io.Reader reader,
                                                  java.lang.String conversionType,
                                                  PropertyDescription descriptor,
                                                  Hashtable parameters)
                                           throws DSETypeException,
                                                  java.io.IOException
Converts the stream into an Object using the appropriate conversion type.

Overrides:
unformatFromReaderForType in class AbstractConverter
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
parameters - com.ibm.btt.base.Hashtable
Returns:
Object
Throws:
java.io.IOException - - If an I/O error occurs
DSETypeException - - If unformatting is unsuccessful

unformatFromReaderForType

public java.lang.Object unformatFromReaderForType(java.io.Reader reader,
                                                  java.lang.String conversionType,
                                                  PropertyDescription descriptor,
                                                  java.util.Locale locale,
                                                  Hashtable parameters)
                                           throws DSETypeException,
                                                  java.io.IOException
Uses the reader to construct an Object of the correct type using the appropriate conversion type and locale.

Overrides:
unformatFromReaderForType in class AbstractConverter
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
locale - Locale
parameters - com.ibm.btt.base.Hashtable
Throws:
java.io.IOException - - If an I/O error occurs
DSETypeException - - If unformatting is unsuccessful

validateParams

public void validateParams(PropertyDescription pd)
                    throws DSETypeException
Validates the externally defined parameters for this converter.

Specified by:
validateParams in interface Conversion
Overrides:
validateParams in class AbstractConverter
Parameters:
pd - com.ibm.btt.base.types.PropertyDescription
Throws:
DSETypeException - - If the parameter validation fails

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2010