|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.openedge.baritus.converters.BaseLocaleConverter
base class for localized converters
Field Summary | |
protected java.util.Locale |
locale
The locale specified to our Constructor, by default - system locale. |
protected boolean |
locPattern
The flag indicating whether the given pattern string is localized or not. |
protected java.lang.String |
pattern
The default pattern specified to our Constructor, if any. |
Constructor Summary | |
protected |
BaseLocaleConverter(java.util.Locale locale,
java.lang.String pattern)
Create a LocaleConverter that will throw a ConversionException
if a conversion error occurs.
|
protected |
BaseLocaleConverter(java.util.Locale locale,
java.lang.String pattern,
boolean locPattern)
Create a LocaleConverter that will throw a ConversionException
if an conversion error occurs. |
Method Summary | |
java.lang.Object |
convert(java.lang.Class type,
java.lang.Object value)
Convert the specified locale-sensitive input object into an output object of the specified type. |
java.lang.Object |
convert(java.lang.Object value)
Convert the specified locale-sensitive input object into an output object. |
java.lang.Object |
convert(java.lang.Object value,
java.lang.String pattern)
Convert the specified locale-sensitive input object into an output object. |
java.util.Locale |
getLocale()
get the locale |
java.lang.String |
getPattern()
get the pattern |
protected abstract 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. |
void |
setLocale(java.util.Locale locale)
set the locale |
void |
setPattern(java.lang.String string)
set the pattern |
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 |
Methods inherited from interface nl.openedge.baritus.converters.Formatter |
format |
Field Detail |
protected java.util.Locale locale
protected java.lang.String pattern
protected boolean locPattern
Constructor Detail |
protected BaseLocaleConverter(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 patternprotected BaseLocaleConverter(java.util.Locale locale, java.lang.String pattern, boolean locPattern)
LocaleConverter
that will throw a ConversionException
if an conversion error occurs.
locale
- The localepattern
- The convertion patternlocPattern
- Indicate whether the pattern is localized or notMethod Detail |
protected abstract java.lang.Object parse(java.lang.Object value, java.lang.String pattern) throws java.text.ParseException
value
- The input object to be convertedpattern
- The pattern is used for the convertion
ConversionException
- if conversion cannot be performed
successfully
java.text.ParseException
public java.lang.Object convert(java.lang.Object value)
value
- The input object to be converted
ConversionException
- if conversion cannot be performed
successfullypublic java.lang.Object convert(java.lang.Object value, java.lang.String pattern)
value
- The input object to be convertedpattern
- The pattern is used for the convertion
ConversionException
- if conversion cannot be performed
successfullypublic java.lang.Object convert(java.lang.Class type, java.lang.Object value)
convert
in interface Converter
type
- Data type to which this value should be convertedvalue
- The input object to be converted
ConversionException
- if conversion cannot be performed
successfullypublic java.util.Locale getLocale()
public java.lang.String getPattern()
public void setLocale(java.util.Locale locale)
locale
- public void setPattern(java.lang.String string)
string
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |