Package lumis.portal.rest.util
Class RichDateTimeXmlAdapter
- java.lang.Object
-
- javax.xml.bind.annotation.adapters.XmlAdapter<RichDateTimeXmlAdapter.RichDateTime,java.util.Date>
-
- lumis.portal.rest.util.RichDateTimeXmlAdapter
-
@StableMinor(version="15.0", sinceVersion="8.0") public class RichDateTimeXmlAdapter extends XmlAdapter<RichDateTimeXmlAdapter.RichDateTime,java.util.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: 25303 $ $Date: 2022-10-22 22:48:02 -0300 (Sat, 22 Oct 2022) $
-
-
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(java.util.Date date)
java.util.Date
unmarshal(RichDateTimeXmlAdapter.RichDateTime richDate)
-
-
-
Method Detail
-
unmarshal
public java.util.Date unmarshal(RichDateTimeXmlAdapter.RichDateTime richDate) throws java.lang.Exception
- Specified by:
unmarshal
in classXmlAdapter<RichDateTimeXmlAdapter.RichDateTime,java.util.Date>
- Throws:
java.lang.Exception
-
marshal
public RichDateTimeXmlAdapter.RichDateTime marshal(java.util.Date date) throws java.lang.Exception
- Specified by:
marshal
in classXmlAdapter<RichDateTimeXmlAdapter.RichDateTime,java.util.Date>
- Throws:
java.lang.Exception
-
-