Class GO_Temporal

Direct Known Subclasses:
GO_Temporal.Since2014

public class GO_Temporal extends XmlAdapter<GO_Temporal,Temporal>
JAXB adapter wrapping the date value in a <gco:Date> or <gco:DateTime> element, for ISO 19115-3 compliance. Only one of Date or DateTime field shall be non-null. At marshalling time, the choice is performed depending on whatever the given date contains hour, minute or seconds fields.

Difference between ISO 19139:2007 and ISO 19115-3:2016

The ISO baseTypes.xsd files define two kinds of date property:
  • gco:Date_PropertyType accepts either gco:Date or gco:DateTime.
  • gco:DateTime_PropertyType accepts only gco:DateTime.
In the legacy standard (ISO 19139:2007), date properties (in particular in citations) were of type Date_PropertyType. But in the new standard (ISO 19115-3:2016), most date properties are of type DateTime_PropertyType, i.e. gco:Date is not legal anymore. The only exception is versionDate in cat:AbstractCT_Catalogue.
Since:
1.3
Version:
1.3
See Also:
  • Field Details

    • dateTime

      private XMLGregorianCalendar dateTime
      The date and time value using the code "DateTime" name. Only one of date and dateTime shall be non-null.
    • date

      private XMLGregorianCalendar date
      The date value using the "Date" name, used when there are no hours, minutes or seconds to format.
  • Constructor Details

    • GO_Temporal

      public GO_Temporal()
      Empty constructor for JAXB.
    • GO_Temporal

      private GO_Temporal(Temporal time)
      Builds a wrapper for the given temporal object.
      Parameters:
      time - the date and time to marshal. Cannot be null.
  • Method Details

    • getDate

      private Temporal getDate()
      Returns the current date, or null if none. If both fields are defined, then dateTime has precedence since it is assumed more accurate.
    • unmarshal

      public final Temporal unmarshal(GO_Temporal value)
      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 class XmlAdapter<GO_Temporal,Temporal>
      Parameters:
      value - the adapter for this metadata value.
      Returns:
      a temporal object which represents the metadata value.
    • marshal

      public GO_Temporal marshal(Temporal value)
      Converts the temporal object to the object to be marshalled in a XML file or stream. JAXB calls automatically this method at marshalling time. The use of <gco:Date> or <gco:DateTime> is determined automatically.
      Specified by:
      marshal in class XmlAdapter<GO_Temporal,Temporal>
      Parameters:
      value - the date value.
      Returns:
      the adapter for this date.