IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.base.types
Class KCollConverter

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

public class KCollConverter
extends AbstractConverter

This class is a generic Converter for compound business objects that are KeyedCollections. This class also provides an extension point for all specific Converters for compound business objects that are KeyedCollections.

See Also:
Serialized Form

Field Summary
 
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
KCollConverter()
          This constructor creates a KCollConverter that supports the conversion types passed as argument.
KCollConverter(java.lang.String[] supportedConversionTypes, java.util.Hashtable keyValuePairs)
          This constructor creates a KCollConverter that supports the conversion types passed as argument.
 
Method Summary
 java.lang.Object convertFrom(java.lang.Object obj, java.lang.String convType, PropertyDescription pd, boolean byReference, java.util.Locale locale)
          Converts an input object into a proper object handled by the converter.
 java.lang.Object convertFrom(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 converter.
 java.lang.Object convertTo(java.lang.Object obj, java.lang.String convType, PropertyDescription pd, boolean byReference, java.util.Locale locale)
          Converts an input KeyedCollection into a proper object handled by the invoker.
 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 KeyedCollection 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 the 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.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, Hashtable parameters)
          Constructs an Object of the correct Type using the specified conversion type and reader.
 java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, java.util.Locale locale, Hashtable parameters)
          Constructs an Object of the correct Type using the specified conversion type, reader, and locale.
 
Methods inherited from class com.ibm.btt.base.types.AbstractConverter
convertFrom, convertFrom, convertFrom, convertTo, convertTo, convertTo, formatToWriter, formatToWriter, formatToWriter, formatToWriterForType, formatToWriterForType, getParameters, getSupportedConversionTypes, readExternal, supportsConversionType, unformat, unformat, unformatFromReader, unformatFromReader, unformatFromReader, unformatFromReader, unformatFromReaderForType, unformatFromReaderForType, validateParams, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KCollConverter

public KCollConverter()
               throws DSETypeException
This constructor creates a KCollConverter that supports the conversion types passed as argument.

Throws:
DSETypeException - - Conversion types passed to superclass is null or empty

KCollConverter

public KCollConverter(java.lang.String[] supportedConversionTypes,
                      java.util.Hashtable keyValuePairs)
               throws DSETypeException
This constructor creates a KCollConverter that supports the conversion types passed as argument.

Parameters:
supportedConversionTypes - String[]
keyValuePairs - Hashtable
Throws:
DSETypeException - - Conversion types passed to superclass is null or empty
Method Detail

convertFrom

public java.lang.Object convertFrom(java.lang.Object obj,
                                    java.lang.String convType,
                                    PropertyDescription pd,
                                    boolean byReference,
                                    java.util.Locale locale)
                             throws DSETypeException
Converts an input object into a proper object handled by the converter. The output object can be set into the data element by the invoker If byReference is true, the conversion, if accepted by the converter, is performed by reference. For the ws convType, this method converts the received object into a com.ibm.btt.base.Hashtable and calls the proper converter for each of the inner elements.

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

convertFrom

public java.lang.Object convertFrom(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 converter. The output object can be set into the data element by the invoker If byReference is true, the conversion, if accepted by the converter, is performed by reference. For the ws convType, this method converts the received object into a com.ibm.btt.base.Hashtable and calls the proper converter for each of the inner elements.

Specified by:
convertFrom in interface Conversion
Overrides:
convertFrom 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.Hashtable
Returns:
java.lang.Object
Throws:
DSETypeException

convertTo

public java.lang.Object convertTo(java.lang.Object obj,
                                  java.lang.String convType,
                                  PropertyDescription pd,
                                  boolean byReference,
                                  java.util.Locale locale)
                           throws DSETypeException
Converts an input KeyedCollection into a proper object handled by the invoker. The output object can be used by the invoker for different purposes and its type is converter dependent. If byReference is true, the conversion, if accepted by the converter, is performed by reference. Note that for the ws convType, this method converts the received kColl into a java.util.Hashtable and calls the proper converter for each of the elements. This is because the KeyedCollection type does not accept conversion 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
Returns:
java.lang.Object
Throws:
DSETypeException

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 KeyedCollection into a proper object handled by the invoker. The output object can be used by the invoker for different purposes and its type is converter dependent. If byReference is true, the conversion, if accepted by the converter, is performed by reference. Note that for the ws convType, this method converts the received kColl into a java.util.Hashtable and calls the proper converter for each of the elements. This is because the KeyedCollection type does not accept conversion 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.Hashtable
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.lang.Exception
Formats the object using the specified conversion type and the writer passed as arguments.

Overrides:
formatToWriterForType in class AbstractConverter
Parameters:
value - Object
conversionType - String
writer - Writer
descriptor - PropertyDescription
parameters - com.ibm.btt.base.Hashtable
Throws:
- - Exception Formatting is unsuccessful
java.lang.Exception

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.lang.Exception
Formats the object using the specified conversion type, locale, and writer passed as arguments.

Overrides:
formatToWriterForType in class AbstractConverter
Parameters:
value - Object
conversionType - String
descriptor - PropertyDescription
writer - Writer
locale - Locale
parameters - com.ibm.btt.base.Hashtable
Throws:
- - Exception Formatting is unsuccessful
java.lang.Exception

unformatFromReaderForType

public java.lang.Object unformatFromReaderForType(java.io.Reader reader,
                                                  java.lang.String conversionType,
                                                  PropertyDescription descriptor,
                                                  Hashtable parameters)
                                           throws java.lang.Exception
Constructs an Object of the correct Type using the specified conversion type and reader.

Overrides:
unformatFromReaderForType in class AbstractConverter
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
parameters - com.ibm.btt.base.Hashtable
Returns:
Object
Throws:
- - DSETypeException Unformatting is unsuccessful
java.lang.Exception - 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 java.lang.Exception
Constructs an Object of the correct Type using the specified conversion type, reader, and locale.

Overrides:
unformatFromReaderForType in class AbstractConverter
Parameters:
reader - Reader
conversionType - String
descriptor - PropertyDescription
locale - Locale
parameters - com.ibm.btt.base.Hashtable
Throws:
- - Exception Unformatting is unsuccessful
java.lang.Exception

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2009