@DecodeType(value=java.util.Date.class) public class DateDecoder extends LocaleAwareDateDecoder implements DataDecoder, DataEncoder
Date
data decoder.
Decodes the supplied string into a Date
value
based on the supplied "format
" parameter, or the default (see below).
The default date format used is "yyyy-MM-dd'T'HH:mm:ss" (see SimpleDateFormat
).
This format is based on the ISO 8601
standard as used by the XML Schema type "dateTime".
This decoder is synchronized on its underlying SimpleDateFormat
instance.LocaleAwareDateDecoder
,
Serialized FormDataDecoder.Factory
decoder, DEFAULT_DATE_FORMAT, format, FORMAT, LOCALE_COUNTRY_CODE, LOCALE_LANGUAGE_CODE, VERIFY_LOCALE
LOCALE
Constructor and Description |
---|
DateDecoder() |
Modifier and Type | Method and Description |
---|---|
Object |
decode(String data)
Decode the supplied String data into a new Object data instance.
|
String |
encode(Object date)
Encode an object to a string.
|
setConfiguration
getConfiguration, getLocale, getLocale, isLocalInstalled
public Object decode(String data) throws DataDecodeException
DataDecoder
decode
in interface DataDecoder
data
- Data to be decoded.DataDecodeException
- Error decoding data.public String encode(Object date) throws DataDecodeException
DataEncoder
encode
in interface DataEncoder
date
- The object to be encoded.DataDecodeException
- Error encoding object.Copyright © 2020. All rights reserved.