com.ibm.dse.base.types
Class AbstractConverter

java.lang.Object
  |
  +--com.ibm.dse.base.types.AbstractConverter
Direct Known Subclasses:
DateConverter, FloatConverter, ICollConverter, IntegerConverter, KCollConverter, NumericStringConverter, StringConverter, TimeConverter

public abstract class AbstractConverter
extends java.lang.Object
implements Conversion, TypeConstants, java.io.Serializable

This class resides at the top of the Converter hierarchy and provides an abstract implementation of the Conversion interface for Type specific Converters to extend.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable keyValuePairs
          The parameterization for this Converter, understood by concrete subclasses
 
Fields inherited from interface com.ibm.dse.base.types.TypeConstants
CONV_TYPE_DEFAULT, CONV_TYPE_HOST, CONV_TYPE_OUTPUT, CONV_TYPE_SER, CONV_TYPE_XML, disabled, hidden, isDisabled, isHidden, isMandatory, isOmitted, isReadOnly, mandatory, omitted, readOnly, TYPE_DEFAULT, TYPE_REGISTRY_INIT_SIZE
 
Constructor Summary
AbstractConverter(java.lang.String[] supportedConversionTypes, java.util.Hashtable keyValuePairs)
          This constructor creates an instance of a Converter which supports the conversion types passed.
 
Method Summary
 void formatToWriter(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor)
          The value passed as an Object is formatted using the specified conversion type and writer passed as argument.
 void formatToWriter(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor, java.util.Locale locale)
          The value passed as an Object is formatted using the specified conversion type, locale and writter passed as argument.
abstract  void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor)
          The value passed as an Object is formatted using the specified conversion type and writer passed as argument.
abstract  void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor, java.util.Locale locale)
          The value passed as an Object is formatted using the specified conversion type, locale and writer passed as argument.Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
 java.util.Hashtable getParameters()
          Returns the keyValuePairs hashtable.
 java.lang.String[] getSupportedConversionTypes()
          Returns an array of conversion types supported by this Converter.
 boolean supportsConversionType(java.lang.String conversionType)
          Returns a flag indicating whether the conversion type passed as argument is supported.
 java.lang.Object unformatFromReader(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor)
          Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type.
 java.lang.Object unformatFromReader(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, java.util.Locale locale)
          Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type, and the given locale.
abstract  java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor)
          Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type.
abstract  java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, java.util.Locale locale)
          Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type and locale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyValuePairs

protected final java.util.Hashtable keyValuePairs
The parameterization for this Converter, understood by concrete subclasses
Constructor Detail

AbstractConverter

public AbstractConverter(java.lang.String[] supportedConversionTypes,
                         java.util.Hashtable keyValuePairs)
                  throws DSETypeException
This constructor creates an instance of a Converter which supports the conversion types passed.
Parameters:
supportedConversionTypes - String[] The supported conversion types.
keyValuePairs - Hashtable The parameterisation for this Converter.
Method Detail

formatToWriter

public void formatToWriter(java.lang.Object value,
                           java.lang.String conversionType,
                           java.io.Writer writer,
                           PropertyDescription descriptor)
                    throws DSETypeException
The value passed as an Object is formatted using the specified conversion type and writer passed as argument. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument. owner descriptor.
Specified by:
formatToWriter in interface Conversion
Parameters:
value - Object Object
conversionType - String
writer - Writer
Throws:
DSETypeException - Formatting is unsuccessful.

formatToWriter

public void formatToWriter(java.lang.Object value,
                           java.lang.String conversionType,
                           java.io.Writer writer,
                           PropertyDescription descriptor,
                           java.util.Locale locale)
                    throws DSETypeException
The value passed as an Object is formatted using the specified conversion type, locale and writter passed as argument. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Specified by:
formatToWriter in interface Conversion
Parameters:
value - Object
conversionType - String
writer - Writer
descriptor - PropertyDescription
locale - Locale

formatToWriterForType

public abstract void formatToWriterForType(java.lang.Object value,
                                           java.lang.String conversionType,
                                           java.io.Writer writer,
                                           PropertyDescription descriptor)
                                    throws java.lang.Exception
The value passed as an Object is formatted using the specified conversion type and writer passed as argument. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Parameters:
value - Object
conversionType - String
writer - Writer
descriptor - PropertyDescriptor
Throws:
java.lang.Exception - Formatting is unsuccessful.

formatToWriterForType

public abstract void formatToWriterForType(java.lang.Object value,
                                           java.lang.String conversionType,
                                           java.io.Writer writer,
                                           PropertyDescription descriptor,
                                           java.util.Locale locale)
                                    throws java.lang.Exception
The value passed as an Object is formatted using the specified conversion type, locale and writer passed as argument.Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Parameters:
value - Object
conversionType - String
writer - Writer
descriptor - PropertyDescription
locale - Locale
Throws:
java.lang.Exception - Formatting is unsuccessful.

getParameters

public java.util.Hashtable getParameters()
Returns the keyValuePairs hashtable.
Returns:
java.util.Hashtable

getSupportedConversionTypes

public java.lang.String[] getSupportedConversionTypes()
Returns an array of conversion types supported by this Converter.
Specified by:
getSupportedConversionTypes in interface Conversion
Returns:
String[]

supportsConversionType

public boolean supportsConversionType(java.lang.String conversionType)
Returns a flag indicating whether the conversion type passed as argument is supported.
Specified by:
supportsConversionType in interface Conversion
Parameters:
conversionType - String
Returns:
boolean

unformatFromReader

public java.lang.Object unformatFromReader(java.io.Reader reader,
                                           java.lang.String conversionType,
                                           PropertyDescription descriptor)
                                    throws DSETypeException
Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Specified by:
unformatFromReader in interface Conversion
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
Returns:
Object
Throws:
DSETypeException - Unformatting is unsuccessful.

unformatFromReader

public java.lang.Object unformatFromReader(java.io.Reader reader,
                                           java.lang.String conversionType,
                                           PropertyDescription descriptor,
                                           java.util.Locale locale)
                                    throws DSETypeException
Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type, and the given locale. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Specified by:
unformatFromReader in interface Conversion
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
locale - Locale
Returns:
Object
Throws:
DSETypeException - Unformatting is unsuccessful.

unformatFromReaderForType

public abstract java.lang.Object unformatFromReaderForType(java.io.Reader reader,
                                                           java.lang.String conversionType,
                                                           PropertyDescription descriptor)
                                                    throws java.lang.Exception
Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
Throws:
java.lang.Exception - Unformatting is unsuccessful.

unformatFromReaderForType

public abstract java.lang.Object unformatFromReaderForType(java.io.Reader reader,
                                                           java.lang.String conversionType,
                                                           PropertyDescription descriptor,
                                                           java.util.Locale locale)
                                                    throws java.lang.Exception
Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type and locale. Parameters required by the specific type converter may be taken from the owner descriptor by using the descriptor passed as argument.
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
locale - Locale
Throws:
java.lang.Exception - Unformatting is unsuccessful.