|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.base.types.AbstractConverter | +--com.ibm.dse.base.types.ext.NumericStringConverter
Converter for business objects of Numeric Type, to convert 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 |
Constructor Summary | |
NumericStringConverter(java.lang.String[] supportedConversionTypes,
java.util.Hashtable keyValuePairs)
Creates a NumericStringConverter object. |
Method Summary | |
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 written to the writer passed as argument. |
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. |
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 the String formats with 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)
Gets the parameters from the descriptor to set the formatter passed. |
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)
Set the value of usePositiveSign to the formatter. |
protected void |
setUseThousandsSeparator(java.text.DecimalFormat formatter,
boolean aBoolean)
Sets the value of useThousandSeparator to aBoolean. |
java.lang.Object |
unformatFromReaderForType(java.io.Reader reader,
java.lang.String conversionType,
PropertyDescription descriptor)
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)
Uses the reader passed to construct an Object of the correct Type using the appropriate conversion type and locale. |
Methods inherited from class com.ibm.dse.base.types.AbstractConverter |
formatToWriter,
formatToWriter,
getParameters,
getSupportedConversionTypes,
supportsConversionType,
unformatFromReader,
unformatFromReader |
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(java.lang.String[] supportedConversionTypes, java.util.Hashtable keyValuePairs) throws DSETypeException
supportedConversionTypes
- java.lang.String[]keyValuePairs
- java.util.HashtableMethod Detail |
public void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor) throws java.io.IOException, DSETypeException
value
- ObjectconversionType
- Stringwriter
- Writerdescriptor
- PropertyDescriptionpublic void formatToWriterForType(java.lang.Object value, java.lang.String conversionType, java.io.Writer writer, PropertyDescription descriptor, java.util.Locale locale) throws java.io.IOException
value
- ObjectconversionType
- Stringwriter
- Writerdescriptor
- PropertyDescriptionlocale
- Localepublic 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 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
- DecimalFormataSeparator
- charprotected void setUsePositiveSign(java.text.DecimalFormat formatter, int anInt)
formatter
- DecimalFormatanInt
- intprotected void setUseThousandsSeparator(java.text.DecimalFormat formatter, boolean aBoolean)
formatter
- DecimalFormataBoolean
- booleanpublic java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor) throws java.io.IOException, DSETypeException
reader
- ReaderconversionType
- Stringdescriptor
- PropertyDescriptionpublic java.lang.Object unformatFromReaderForType(java.io.Reader reader, java.lang.String conversionType, PropertyDescription descriptor, java.util.Locale locale) throws java.io.IOException, DSETypeException
reader
- ReaderconversionType
- Stringdescriptor
- PropertyDescriptionlocale
- Locale
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |