|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.openedge.baritus.converters.BaseLocaleConverter nl.openedge.baritus.converters.DecimalLocaleConverter
Modified LocaleConverter
implementation for this framework
Field Summary | |
protected java.util.regex.Pattern |
nonDigitPattern
|
Fields inherited from class nl.openedge.baritus.converters.BaseLocaleConverter |
locale, locPattern, pattern |
Constructor Summary | |
DecimalLocaleConverter()
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
|
DecimalLocaleConverter(java.util.Locale locale)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
|
DecimalLocaleConverter(java.util.Locale locale,
java.lang.String pattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
|
DecimalLocaleConverter(java.util.Locale locale,
java.lang.String pattern,
boolean locPattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
Method Summary | |
java.lang.String |
format(java.lang.Object value,
java.lang.String pattern)
Convert the specified input object into a locale-sensitive output string |
protected java.text.DecimalFormat |
getFormat(java.lang.String pattern)
get format and optionally apply pattern if given |
protected java.lang.Number |
getNumber(java.lang.Object value,
java.lang.String pattern)
translate value to a number optionally using the supplied pattern |
protected java.lang.Object |
parse(java.lang.Object value,
java.lang.String pattern)
Convert the specified locale-sensitive input object into an output object of the specified type. |
Methods inherited from class nl.openedge.baritus.converters.BaseLocaleConverter |
convert, convert, convert, getLocale, getPattern, setLocale, setPattern |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface nl.openedge.baritus.converters.LocaleConverter |
convert |
Field Detail |
protected java.util.regex.Pattern nonDigitPattern
Constructor Detail |
public DecimalLocaleConverter()
LocaleConverter
that will throw a ConversionException
if a conversion error occurs. The locale is the default locale for
this instance of the Java Virtual Machine and an unlocalized pattern is used
for the convertion.
public DecimalLocaleConverter(java.util.Locale locale)
LocaleConverter
that will throw a ConversionException
if a conversion error occurs. No pattern is used for the convertion.
locale
- The localepublic DecimalLocaleConverter(java.util.Locale locale, java.lang.String pattern)
LocaleConverter
that will throw a ConversionException
if a conversion error occurs. An unlocalized pattern is used for the convertion.
locale
- The localepattern
- The convertion patternpublic DecimalLocaleConverter(java.util.Locale locale, java.lang.String pattern, boolean locPattern)
LocaleConverter
that will throw a ConversionException
if a conversion error occurs.
locale
- The localepattern
- The convertion patternlocPattern
- Indicate whether the pattern is localized or notMethod Detail |
protected java.lang.Object parse(java.lang.Object value, java.lang.String pattern) throws java.text.ParseException
parse
in class BaseLocaleConverter
value
- The input object to be convertedpattern
- The pattern is used for the conversion
ConversionException
- if conversion cannot be performed successfully
java.text.ParseException
public java.lang.String format(java.lang.Object value, java.lang.String pattern) throws java.lang.IllegalArgumentException
value
- The input object to be formattedpattern
- The pattern is used for the conversion
java.lang.IllegalArgumentException
- if formatting cannot be performed successfullyprotected java.text.DecimalFormat getFormat(java.lang.String pattern)
pattern
- pattern or null
protected java.lang.Number getNumber(java.lang.Object value, java.lang.String pattern) throws ConversionException
value
- the value to convertpattern
- the patter to use (optional)
ConversionException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |