Package org.apache.sis.internal.jaxb.gml
Class DateAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<XMLGregorianCalendar,Date>
org.apache.sis.internal.jaxb.gml.DateAdapter
JAXB adapter wrapping the date value (as milliseconds elapsed since January 1st, 1970) in a
XMLGregorianCalendar for the xs:date type. Hours, minutes and seconds are
discarded.
Using this adapter is equivalent to apply the following annotation on a Date field:
XML.TIMEZONE property.- Since:
- 0.4
- Version:
- 0.4
- See Also:
-
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.
-
Constructor Details
-
DateAdapter
public DateAdapter()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:
unmarshalin classXmlAdapter<XMLGregorianCalendar,Date> - Parameters:
value- the XML date, ornull.- Returns:
- the
java.utildate, 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:
marshalin classXmlAdapter<XMLGregorianCalendar,Date> - Parameters:
value- thejava.utildate value, ornull.- Returns:
- the XML date, or
null.
-