Package lumis.portal.rest.util
Class RichDateTimeXmlAdapter
- java.lang.Object
-
- javax.xml.bind.annotation.adapters.XmlAdapter<RichDateTimeXmlAdapter.RichDateTime,Date>
-
- lumis.portal.rest.util.RichDateTimeXmlAdapter
-
@StableMinor(version="14.0", sinceVersion="8.0") public class RichDateTimeXmlAdapter extends XmlAdapter<RichDateTimeXmlAdapter.RichDateTime,Date>
Adapter for a richer date-time format for use in JAXB. Outputs in ISO-8601, timeInMillis (milliseconds since January 1, 1970, 00:00:00 GMT) and user's locale default format. Accepts input in ISO-8601 and timeInMillis.Sample date output in JSON:
{"iso":"2014-09-08T15:29:34.251-03:00","timeInMillis":1410200974251,"formatted":"08/09/14 15:29"}
Sample date input formats in JSON:
- {"iso":"2014-09-08T15:29:34.251-03:00"}
- {"timeInMillis":1410200974251}
- "2014-09-08T15:29:34.251-03:00"
- 1410200974251
- Since:
- 8.0.0
- Version:
- $Revision: 24477 $ $Date: 2021-04-28 11:30:36 -0300 (Wed, 28 Apr 2021) $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RichDateTimeXmlAdapter.RichDateTime
JAXB mapped class used as Date adaptation byRichDateTimeXmlAdapter
.
-
Constructor Summary
Constructors Constructor Description RichDateTimeXmlAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RichDateTimeXmlAdapter.RichDateTime
marshal(Date date)
Date
unmarshal(RichDateTimeXmlAdapter.RichDateTime richDate)
-
-
-
Method Detail
-
unmarshal
public Date unmarshal(RichDateTimeXmlAdapter.RichDateTime richDate) throws Exception
- Specified by:
unmarshal
in classXmlAdapter<RichDateTimeXmlAdapter.RichDateTime,Date>
- Throws:
Exception
-
marshal
public RichDateTimeXmlAdapter.RichDateTime marshal(Date date) throws Exception
- Specified by:
marshal
in classXmlAdapter<RichDateTimeXmlAdapter.RichDateTime,Date>
- Throws:
Exception
-
-