Package org.apache.sis.internal.jaxb.gml
Class UniversalTimeAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<XMLGregorianCalendar,Date>
org.apache.sis.internal.jaxb.gml.UniversalTimeAdapter
JAXB adapter wrapping the date value (as milliseconds elapsed since January 1st, 1970) in a
XMLGregorianCalendar
for the xs:dateTime
type with the timezone forced to UTC.
The milliseconds are omitted if not different than zero.- Since:
- 0.4
- Version:
- 0.4
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts the date to the object to be marshalled in a XML file or stream.unmarshal
(XMLGregorianCalendar value) Converts a date read from a XML stream to the object which will contain the value.
-
Field Details
-
UTC
The timezone of the date to marshal with this adapter.
-
-
Constructor Details
-
UniversalTimeAdapter
public UniversalTimeAdapter()Empty constructor for JAXB only.
-
-
Method Details
-
unmarshal
Converts a date read from a XML stream to the object which will contain the value. JAXB calls automatically this method at unmarshalling time.- Specified by:
unmarshal
in classXmlAdapter<XMLGregorianCalendar,
Date> - Parameters:
value
- the XML date, ornull
.- Returns:
- the
java.util
date, ornull
.
-
marshal
Converts the date to the object to be marshalled in a XML file or stream. JAXB calls automatically this method at marshalling time.- Specified by:
marshal
in classXmlAdapter<XMLGregorianCalendar,
Date> - Parameters:
value
- thejava.util
date value, ornull
.- Returns:
- the XML date, or
null
.
-