org.apache.commons.beanutils.locale.converters
public class DateLocaleConverter extends BaseLocaleConverter
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 | |
---|---|
boolean | isLenient Should the date conversion be lenient? |
static Log | log All logging goes through this logger |
Constructor Summary | |
---|---|
DateLocaleConverter()
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. | |
DateLocaleConverter(boolean locPattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. | |
DateLocaleConverter(Locale locale)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. | |
DateLocaleConverter(Locale locale, boolean locPattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs.
| |
DateLocaleConverter(Locale locale, String pattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs. | |
DateLocaleConverter(Locale locale, String pattern, boolean locPattern)
Create a LocaleConverter
that will throw a ConversionException
if a conversion error occurs.
| |
DateLocaleConverter(Object defaultValue)
Create a LocaleConverter
that will return the specified default value
if a conversion error occurs. | |
DateLocaleConverter(Object defaultValue, boolean locPattern)
Create a LocaleConverter
that will return the specified default value
if a conversion error occurs. | |
DateLocaleConverter(Object defaultValue, Locale locale)
Create a LocaleConverter
that will return the specified default value
if a conversion error occurs. | |
DateLocaleConverter(Object defaultValue, Locale locale, boolean locPattern)
Create a LocaleConverter
that will return the specified default value
if a conversion error occurs.
| |
DateLocaleConverter(Object defaultValue, Locale locale, String pattern)
Create a LocaleConverter
that will return the specified default value
if a conversion error occurs. | |
DateLocaleConverter(Object defaultValue, Locale locale, String pattern, boolean locPattern)
Create a LocaleConverter
that will return the specified default value
if a conversion error occurs.
|
Method Summary | |
---|---|
SimpleDateFormat | getFormatter(String pattern, Locale locale)
Gets an appropriate SimpleDateFormat for given locale,
default Date format pattern is not provided. |
boolean | isLenient()
Returns whether date formatting is lenient.
|
protected Object | parse(Object value, String pattern)
Convert the specified locale-sensitive input object into an output object of the
specified type.
|
void | setLenient(boolean lenient)
Specify whether or not date-time parsing should be lenient.
|
Parameters: locPattern Indicate whether the pattern is localized or not
Parameters: locale The locale
Parameters: locale The locale locPattern Indicate whether the pattern is localized or not
Parameters: locale The locale pattern The convertion pattern
Parameters: locale The locale pattern The convertion pattern locPattern Indicate whether the pattern is localized or not
Parameters: defaultValue The default value to be returned
Parameters: defaultValue The default value to be returned locPattern Indicate whether the pattern is localized or not
Parameters: defaultValue The default value to be returned locale The locale
Parameters: defaultValue The default value to be returned locale The locale locPattern Indicate whether the pattern is localized or not
Parameters: defaultValue The default value to be returned locale The locale pattern The convertion pattern
Parameters: defaultValue The default value to be returned locale The locale pattern The convertion pattern locPattern Indicate whether the pattern is localized or not
SimpleDateFormat
for given locale,
default Date format pattern is not provided.Returns: true if the DateFormat
used for formatting is lenient
See Also: java.text.DateFormat#isLenient
Parameters: value The input object to be converted pattern The pattern is used for the convertion
Throws: org.apache.commons.beanutils.ConversionException if conversion cannot be performed successfully
Parameters: lenient true if the DateFormat
used for formatting should be lenient
See Also: java.text.DateFormat#setLenient