|
|||||||||||
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.DateLocaleConverter
Standard LocaleConverter
implementation that converts an incoming
locale-sensitive String into a java.util.Date
object,
optionally using a default value or throwing a
ConversionException
if a conversion error occurs.
Field Summary |
Fields inherited from class nl.openedge.baritus.converters.BaseLocaleConverter |
locale, locPattern, pattern |
Constructor Summary | |
DateLocaleConverter()
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
|
DateLocaleConverter(java.util.Locale locale)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
|
DateLocaleConverter(java.util.Locale locale,
java.lang.String pattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. |
Method Summary | |
java.lang.Object |
convert(java.lang.Class type,
java.lang.Object value,
java.lang.String pattern)
Convert the specified locale-sensitive input object into an output object of the specified type. |
java.lang.String |
format(java.lang.Object value,
java.lang.String pattern)
format value with pattern or using the default pattern |
int |
getDateStyle()
get date style |
boolean |
isLenient()
Returns whether date formatting is lenient. |
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. |
void |
setDateStyle(int dateStyle)
set date style |
void |
setLenient(boolean lenient)
Specify whether or not date-time parsing should be lenient. |
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 |
Constructor Detail |
public DateLocaleConverter()
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 DateLocaleConverter(java.util.Locale locale)
LocaleConverter
that will throw a ConversionException
if a conversion error occurs. An unlocalized pattern is used for the convertion.
locale
- The localepublic DateLocaleConverter(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 patternMethod Detail |
public boolean isLenient()
DateFormat
used for formatting is lenientDateFormat.isLenient()
public void setLenient(boolean lenient)
lenient
- true if the DateFormat
used for formatting should be lenientDateFormat.setLenient(boolean)
public int getDateStyle()
public void setDateStyle(int dateStyle)
dateStyle
- protected java.lang.Object parse(java.lang.Object value, java.lang.String pattern) throws ConversionException
parse
in class BaseLocaleConverter
value
- The input object to be convertedpattern
- The pattern is used for the convertion
ConversionException
- if conversion cannot be performed
successfullypublic 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 successfullyFormatter.format(java.lang.Object, java.lang.String)
public java.lang.Object convert(java.lang.Class type, java.lang.Object value, java.lang.String pattern)
type
- Data type to which this value should be convertedvalue
- The input object to be convertedpattern
- The pattern is used for the convertion
ConversionException
- if conversion cannot be performed
successfully
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |