Package org.apache.sis.internal.jaxb.gco
Class GO_Temporal
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<GO_Temporal,Temporal>
org.apache.sis.internal.jaxb.gco.GO_Temporal
- Direct Known Subclasses:
GO_Temporal.Since2014
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 ISObaseTypes.xsd
files define two kinds of date property:
gco:Date_PropertyType
accepts eithergco:Date
orgco:DateTime
.gco:DateTime_PropertyType
accepts onlygco:DateTime
.
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Wraps the value only if marshalling ISO 19115-3 element. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate XMLGregorianCalendar
The date value using the"Date"
name, used when there are no hours, minutes or seconds to format.private XMLGregorianCalendar
The date and time value using thecode "DateTime"
name. -
Constructor Summary
ConstructorsModifierConstructorDescriptionEmpty constructor for JAXB.private
GO_Temporal
(Temporal time) Builds a wrapper for the given temporal object. -
Method Summary
Modifier and TypeMethodDescriptionprivate Temporal
getDate()
Returns the current date, ornull
if none.Converts the temporal object to the object to be marshalled in a XML file or stream.final Temporal
unmarshal
(GO_Temporal value) Converts a date read from a XML stream to the object which will contain the value.
-
Field Details
-
dateTime
The date and time value using thecode "DateTime"
name. Only one ofdate
anddateTime
shall be non-null. -
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
Builds a wrapper for the given temporal object.- Parameters:
time
- the date and time to marshal. Cannot benull
.
-
-
Method Details
-
getDate
Returns the current date, ornull
if none. If both fields are defined, thendateTime
has precedence since it is assumed more accurate. -
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<GO_Temporal,
Temporal> - Parameters:
value
- the adapter for this metadata value.- Returns:
- a temporal object which represents the metadata value.
-
marshal
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 classXmlAdapter<GO_Temporal,
Temporal> - Parameters:
value
- the date value.- Returns:
- the adapter for this date.
-