public abstract class AbstractCoerceToDate extends AbstractCoercion
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) |
java.lang.Object |
coerce(java.lang.Object value,
CoercionContext context) |
protected java.lang.Object |
coerce(java.lang.Object value,
java.text.DateFormat[] formatters) |
protected abstract java.lang.String |
getDateType()
Returns the name of the Date type being coerced.
|
protected abstract java.text.DateFormat[] |
getFormatters(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.util.Date |
now() |
protected java.util.Date |
valueOf(java.util.Date value) |
protected java.util.Date |
valueOf(java.lang.String value) |
public java.lang.Object coerce(java.lang.Object value)
throws CoercionException
coerce in interface Coercioncoerce in class AbstractCoercionCoercionExceptionpublic java.lang.Object coerce(java.lang.Object value,
CoercionContext context)
throws CoercionException
CoercionExceptionprotected java.lang.Object coerce(java.lang.Object value,
java.text.DateFormat[] formatters)
throws CoercionException
CoercionExceptionprotected abstract java.text.DateFormat[] getFormatters(java.util.Locale locale)
DateFormat to apply when the value to coerce is not of
Date type and it will be parsed as String.locale - DateFormat to apply to parse the value to coerce as
Stringprotected java.util.Date now()
protected java.util.Date valueOf(java.lang.String value)
protected java.util.Date valueOf(java.util.Date value)
protected abstract java.lang.String getDateType()