public abstract class AbstractCoerceToDate extends java.lang.Object implements DataTypesManager.CoercionWithLocale
Date, it will use the Object.toString() method to convert the
resulting String to a Date object.| Constructor and Description |
|---|
AbstractCoerceToDate() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
coerce(java.lang.Object value) |
protected java.lang.Object |
coerce(java.lang.Object value,
java.text.DateFormat dateFormatter) |
java.lang.Object |
coerce(java.lang.Object value,
java.util.Locale locale) |
protected abstract 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 abstract java.lang.String |
getDateType()
Returns the name of the Date type being coerced.
|
public java.lang.Object coerce(java.lang.Object value)
throws CoercionException
coerce in interface DataTypesManager.CoercionCoercionExceptionpublic java.lang.Object coerce(java.lang.Object value,
java.util.Locale locale)
throws CoercionException
coerce in interface DataTypesManager.CoercionWithLocaleCoercionExceptionprotected java.lang.Object coerce(java.lang.Object value,
java.text.DateFormat dateFormatter)
throws CoercionException
CoercionExceptionprotected abstract java.text.DateFormat createFormatter(java.util.Locale locale)
DateFormat to apply when the value to coerce is not
of Date type and it will be parsed as String.DateFormat to apply to parse the value to coerce as
Stringprotected abstract java.lang.String getDateType()