public class CoerceToDate extends AbstractCoerceToDate
Date. If the value is not a Date, it
will use the Object.toString() method to convert the
resulting String to a Date object using the current locale default
formatter for Date through the DateFormat.getDateInstance(int) method
and the DateFormat.SHORT style.| Constructor and Description |
|---|
CoerceToDate() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
coerce(java.lang.Object value) |
protected java.text.DateFormat |
createFormatter(java.util.Locale locale)
Returns the
DateFormat to apply when the value to coerce is not
of Date type and it will be parsed as String. |
protected java.lang.String |
getDateType()
Returns the name of the Date type being coerced.
|
coerce, coerceprotected java.text.DateFormat createFormatter(java.util.Locale locale)
AbstractCoerceToDateDateFormat to apply when the value to coerce is not
of Date type and it will be parsed as String.createFormatter in class AbstractCoerceToDateDateFormat to apply to parse the value to coerce as
Stringpublic java.lang.Object coerce(java.lang.Object value)
throws CoercionException
coerce in interface DataTypesManager.Coercioncoerce in class AbstractCoerceToDateCoercionExceptionprotected java.lang.String getDateType()
AbstractCoerceToDategetDateType in class AbstractCoerceToDate