Package google.registry.xml
Class UtcDateTimeAdapter
java.lang.Object
jakarta.xml.bind.annotation.adapters.XmlAdapter<String,org.joda.time.DateTime>
google.registry.xml.UtcDateTimeAdapter
public class UtcDateTimeAdapter
extends jakarta.xml.bind.annotation.adapters.XmlAdapter<String,org.joda.time.DateTime>
Adapter to use Joda
DateTime
when marshalling XML timestamps.
These fields shall contain timestamps indicating the date and time in UTC as specified in
RFC3339, with no offset from the zero meridian. For example: 2010-10-17T00:00:00Z
.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getFormattedString
(org.joda.time.DateTime timestamp) Same asmarshal(DateTime)
, but in a convenient static format.marshal
(org.joda.time.DateTime timestamp) ConvertsDateTime
to UTC and returns it as an RFC3339 string.org.joda.time.DateTime
Parses an ISO timestamp string into a UTCDateTime
object, converting timezones if necessary.
-
Constructor Details
-
UtcDateTimeAdapter
public UtcDateTimeAdapter()
-
-
Method Details
-
getFormattedString
Same asmarshal(DateTime)
, but in a convenient static format. -
unmarshal
Parses an ISO timestamp string into a UTCDateTime
object, converting timezones if necessary. Iftimestamp
is empty ornull
thennull
is returned.- Specified by:
unmarshal
in classjakarta.xml.bind.annotation.adapters.XmlAdapter<String,
org.joda.time.DateTime>
-
marshal
ConvertsDateTime
to UTC and returns it as an RFC3339 string. Iftimestamp
isnull
then an empty string is returned.- Specified by:
marshal
in classjakarta.xml.bind.annotation.adapters.XmlAdapter<String,
org.joda.time.DateTime>
-