|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.dse.base.types.AbstractConverter
com.ibm.dse.base.types.ext.NumericStringConverter
This is the converter for business objects of the Numeric type. It converts them into strings using the java.text.DecimalFormat initialized by attributes of this class.
Field Summary | |
---|---|
protected int |
decimalPlaces
|
protected char |
decimalSeparator
|
int |
signRule
|
protected char |
thousandsSeparator
|
int |
usePositiveSign
|
protected boolean |
useThousandsSeparator
|
Fields inherited from class com.ibm.dse.base.types.AbstractConverter |
---|
keyValuePairs |
Fields inherited from interface com.ibm.dse.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 | |
---|---|
NumericStringConverter()
Creates a NumericStringConverter object. |
|
NumericStringConverter(java.lang.String[] supportedConversionTypes,
java.util.Hashtable keyValuePairs)
Creates a NumericStringConverter 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 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. |
int |
getDecimalPlaces()
Returns the number of decimal digits when the String is formatted. |
char |
getDecimalSeparator()
Returns the value of decimalSeparator. |
boolean |
getShowDecimals()
Returns true if the String formats with decimal places. |
int |
getSignRule()
Returns the value of signRule. |
char |
getThousandsSeparator()
Returns the value of thousandsSeparator. |
int |
getUsePositiveSign()
Returns the value of usePositiveSign. |
boolean |
getUseThousandsSeparator()
Returns true if the String uses a thousands separator. |
protected void |
setDecimalPlaces(java.text.DecimalFormat formatter,
int anInt)
Sets the value of decimalPlaces of the formatter to anInt. |
protected void |
setDecimalSeparator(java.text.DecimalFormat formatter,
char aDecimalSeparator)
Sets the value of decimalSeparator of the formatter to aDecimalSeparator. |
protected void |
setParameters(java.text.DecimalFormat formatter,
PropertyDescription descriptor)
Sets the parameters using the type's Constants. |
protected void |
setParameters(java.text.DecimalFormat formatter,
PropertyDescription descriptor,
Hashtable parameters)
Sets the parameters using the type's Constants. |
protected void |
setSignPolicy(java.text.DecimalFormat formatter)
Sets the parameters of the formatter using the values of usePositiveSign and signRule. |
protected void |
setSignRule(java.text.DecimalFormat formatter,
int anInt)
Sets the value of signRule. |
protected void |
setThousandsSeparator(java.text.DecimalFormat formatter,
char aChar)
Sets the value of thousandsSeparator of the formatter to aChar. |
protected void |
setUsePositiveSign(java.text.DecimalFormat formatter,
int anInt)
Sets the value of usePositiveSign to the formatter. |
protected void |
setUseThousandsSeparator(java.text.DecimalFormat formatter,
boolean aBoolean)
Sets the value of useThousandSeparator to aBoolean. |
protected java.lang.Object |
unformat(java.lang.String aNumberAsString,
java.lang.String convType,
PropertyDescription descriptor,
java.util.Locale locale)
Converts a String representing a Number into another Number. |
protected java.lang.Object |
unformat(java.lang.String aNumberAsString,
java.lang.String convType,
PropertyDescription descriptor,
java.util.Locale locale,
Hashtable parameters)
Converts a String representing a Number into another Number. |
java.lang.Object |
unformatFromReaderForType(java.io.Reader reader,
java.lang.String conversionType,
PropertyDescription descriptor,
Hashtable parameters)
Converts the stream passed to 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)
Constructs 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.dse.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 |
public int usePositiveSign
public int signRule
protected boolean useThousandsSeparator
protected int decimalPlaces
protected char decimalSeparator
protected char thousandsSeparator
Constructor Detail |
public NumericStringConverter() throws DSETypeException
DSETypeException
- - If the supportedConversionTypes parameter passed to the superclass is null or emptypublic NumericStringConverter(java.lang.String[] supportedConversionTypes, java.util.Hashtable keyValuePairs) throws DSETypeException
supportedConversionTypes
- java.lang.String[]keyValuePairs
- java.util.Hashtable
DSETypeException
- - If the supportedConversionTypes parameter passed to the superclass is null or emptyMethod Detail |
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
convertTo
in interface Conversion
convertTo
in class AbstractConverter
obj
- java.lang.ObjectconvType
- java.lang.Stringpd
- com.ibm.dse.base.types.PropertyDescriptionbyReference
- booleanlocale
- Localeparameters
- com.ibm.dse.base.Hashtable
DSETypeException
public void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor, Hashtable parameters) throws java.io.IOException, DSETypeException
formatToWriterForType
in class AbstractConverter
value
- ObjectconversionType
- Stringwriter
- Writerdescriptor
- PropertyDescriptionparameters
- com.ibm.dse.base.Hashtable
java.io.IOException
- - If an I/O error occurs
DSETypeException
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
formatToWriterForType
in class AbstractConverter
value
- ObjectconversionType
- Stringwriter
- Writerdescriptor
- PropertyDescriptionlocale
- Localeparameters
- com.ibm.dse.base.Hashtable
java.io.IOException
- - If an I/O error occurspublic int getDecimalPlaces()
public char getDecimalSeparator()
public boolean getShowDecimals()
public int getSignRule()
public char getThousandsSeparator()
public int getUsePositiveSign()
public boolean getUseThousandsSeparator()
protected void setDecimalPlaces(java.text.DecimalFormat formatter, int anInt)
formatter
- DecimalFormatanInt
- intprotected void setDecimalSeparator(java.text.DecimalFormat formatter, char aDecimalSeparator)
formatter
- DecimalFormataDecimalSeparator
- charprotected void setParameters(java.text.DecimalFormat formatter, PropertyDescription descriptor)
formatter
- java.text.DecimalFormatdescriptor
- com.ibm.dse.base.types.PropertyDescriptionprotected void setParameters(java.text.DecimalFormat formatter, PropertyDescription descriptor, Hashtable parameters)
formatter
- java.text.DecimalFormatdescriptor
- com.ibm.dse.base.types.PropertyDescriptionparameters
- com.ibm.dse.base.Hashtableprotected void setSignPolicy(java.text.DecimalFormat formatter)
formatter
- DecimalFormatprotected void setSignRule(java.text.DecimalFormat formatter, int anInt)
formatter
- DecimalFormatanInt
- intprotected void setThousandsSeparator(java.text.DecimalFormat formatter, char aChar)
formatter
- DecimalFormatprotected void setUsePositiveSign(java.text.DecimalFormat formatter, int anInt)
formatter
- DecimalFormatanInt
- intprotected void setUseThousandsSeparator(java.text.DecimalFormat formatter, boolean aBoolean)
formatter
- DecimalFormataBoolean
- booleanprotected java.lang.Object unformat(java.lang.String aNumberAsString, java.lang.String convType, PropertyDescription descriptor, java.util.Locale locale) throws DSETypeException
unformat
in class AbstractConverter
locale
- java.util.Locale;convType
- java.lang.Stringdescriptor
- com.ibm.dse.base.types.PropertyDescription
DSETypeException
protected java.lang.Object unformat(java.lang.String aNumberAsString, java.lang.String convType, PropertyDescription descriptor, java.util.Locale locale, Hashtable parameters) throws DSETypeException
unformat
in class AbstractConverter
locale
- java.util.Locale;parameters
- com.ibm.dse.base.HashtableconvType
- java.lang.Stringdescriptor
- com.ibm.dse.base.types.PropertyDescription
DSETypeException
public java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, Hashtable parameters) throws java.io.IOException, DSETypeException
unformatFromReaderForType
in class AbstractConverter
reader
- ReaderconversionType
- Stringdescriptor
- PropertyDescriptionparameters
- com.ibm.dse.base.Hashtable
java.io.IOException
- - If an I/O error occurs
DSETypeException
- - If unformatting is unsuccessfulpublic java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, java.util.Locale locale, Hashtable parameters) throws java.io.IOException, DSETypeException
unformatFromReaderForType
in class AbstractConverter
reader
- ReaderconversionType
- Stringdescriptor
- PropertyDescriptionlocale
- Localeparameters
- com.ibm.dse.base.Hashtable
java.io.IOException
- - If an I/O error occurs
DSETypeException
- - If uUnformatting is unsuccessfulpublic void validateParams(PropertyDescription pd) throws DSETypeException
validateParams
in interface Conversion
validateParams
in class AbstractConverter
pd
- com.ibm.dse.base.types.PropertyDescription
DSETypeException
- - If parameter validation fails
|
IBM Branch Transformation Toolkit Javadoc | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |