org.milyn.javabean.decoders
Class DateDecoder
java.lang.Object
org.milyn.javabean.decoders.LocaleAwareDecoder
org.milyn.javabean.decoders.LocaleAwareDateDecoder
org.milyn.javabean.decoders.DateDecoder
- All Implemented Interfaces:
- Serializable, Configurable, DataDecoder, DataEncoder
- Direct Known Subclasses:
- SqlDateDecoder, SqlTimeDecoder, SqlTimestampDecoder, XMLGregorianCalendarDecoder
@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.
- Author:
- tom.fennelly@gmail.com
- See Also:
LocaleAwareDateDecoder,
Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DateDecoder
public DateDecoder()
decode
public Object decode(String data)
throws DataDecodeException
- Description copied from interface:
DataDecoder
- Decode the supplied String data into a new Object data instance.
- Specified by:
decode in interface DataDecoder
- Parameters:
data - Data to be decoded.
- Returns:
- Decoded data Object.
- Throws:
DataDecodeException - Error decoding data.
encode
public String encode(Object date)
throws DataDecodeException
- Description copied from interface:
DataEncoder
- Encode an object to a string.
- Specified by:
encode in interface DataEncoder
- Parameters:
date - The object to be encoded.
- Returns:
- The encoded object.
- Throws:
DataDecodeException - Error encoding object.
Copyright © 2018. All rights reserved.