public class DateTypeHandler extends DateTypeHandlerSupport
Date
,
DateFormat
,
SimpleDateFormat
lenient, pattern, timeZone
locale
FORMAT_SETTING
NIL
Constructor and Description |
---|
DateTypeHandler()
Constructs a new DateTypeHandler.
|
DateTypeHandler(String pattern)
Constructs a new DateTypeHandler.
|
Modifier and Type | Method and Description |
---|---|
String |
format(Object value)
Formats a Java object into field text.
|
Class<?> |
getType()
Returns the class type supported by this handler.
|
Date |
parse(String text)
Parses field text into a Java object.
|
createDateFormat, createDefaultDateFormat, formatDate, getPattern, getTimeZone, getTimeZoneId, isLenient, newInstance, parseDate, setLenient, setPattern, setTimeZoneId
getLocale, setLocale
public DateTypeHandler()
public DateTypeHandler(String pattern)
pattern
- the SimpleDateFormat patternpublic Date parse(String text) throws TypeConversionException
TypeHandler
text
- the field text to parse, which may be null if the field was not passed in the recordTypeConversionException
- if the text cannot be parsedpublic String format(Object value)
TypeHandler
value
- the Java object to format, which may be nullTypeHandler.NIL
for XML formatted streamspublic Class<?> getType()
TypeHandler