|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.formproc.conversion.AbstractTypeConverter | +--org.formproc.conversion.DateConverter
TypeConverter which converts to a Date. The data objects toString() method will be used to convert the data object to a String first.
This class includes a property parse
which controls
date parsing with following attributes: type
,
dateStyle
, timeStyle
, pattern
.
Possible values for type
attribute are:
Possible values for dateStyle
and timeStyle
attributes are:
For possible values for pattern
see
java.text.SimpleDateFormat apidocs.
Constructor Summary | |
DateConverter()
|
Method Summary | |
java.lang.Object |
convert(java.lang.Object data,
java.util.Locale locale)
Convert the given data object to a Date. |
void |
loadConfiguration(com.anthonyeden.lib.config.Configuration configuration)
Load the converter's configuration. |
void |
setDateStyle(java.lang.String dateStyle)
Set the date style property. |
void |
setPattern(java.lang.String pattern)
Set the pattern property. |
void |
setTimeStyle(java.lang.String timeStyle)
Set the time style property. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DateConverter()
Method Detail |
public java.lang.Object convert(java.lang.Object data, java.util.Locale locale) throws java.lang.Exception
data
- The datalocale
- The Locale
java.lang.Exception
public void setDateStyle(java.lang.String dateStyle)
dateStyle
- public void setTimeStyle(java.lang.String timeStyle)
timeStyle
- public void setPattern(java.lang.String pattern)
pattern
- public void loadConfiguration(com.anthonyeden.lib.config.Configuration configuration) throws com.anthonyeden.lib.config.ConfigurationException
loadConfiguration
in interface TypeConverter
loadConfiguration
in class AbstractTypeConverter
configuration
- The configuration object
com.anthonyeden.lib.config.ConfigurationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |