Class GMLAdapter

java.lang.Object
org.apache.sis.internal.jaxb.gml.GMLAdapter
Direct Known Subclasses:
TimeInstant, TimePeriod

public abstract class GMLAdapter extends Object
Base class for GML objects that are wrappers around a GeoAPI implementation. Every GML object to be marshalled have an ID attribute, which is mandatory. If no ID is explicitly set, a default one will be created from the wrapped object.
Note: This class is somewhat temporary. It assigns the ID to the wrapped object. In a future SIS version, we should assign the ID to the object itself.
Since:
0.3
Version:
0.4
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private String
    The period identifier, or null if undefined.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a new GML object with no ID.
    protected
    GMLAdapter(Object wrapped)
    Creates a new GML object wrapping the given GeoAPI implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    copyIdTo(Object wrapped)
    Assigns the id value (if non-null) to the given object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      private String id
      The period identifier, or null if undefined. This element is part of GML 3.1.1 specification.

      Difference between gco:uuid and gml:id

      • id is a standard GML attribute available on every object-with-identity. It has type="xs:ID" - i.e. it is a fragment identifier, unique within document scope only, for internal cross-references. It is not useful by itself as a persistent unique identifier.
      • uuid is an optional attribute available on every object-with-identity, provided in the GMD schemas that implement ISO 19115 in XML. May be used as a persistent unique identifier, but only available within GMD context.
      See Also:
  • Constructor Details

    • GMLAdapter

      protected GMLAdapter()
      Creates a new GML object with no ID. This constructor is typically invoked at unmarshalling time. The id value will then be set by JAXB.
      See Also:
    • GMLAdapter

      protected GMLAdapter(Object wrapped)
      Creates a new GML object wrapping the given GeoAPI implementation. The ID will be determined from the given object.

      This constructor is typically invoked at marshalling time. The id value set by this constructor will be used by JAXB for producing the XML.

      Parameters:
      wrapped - an instance of a GeoAPI interface to be wrapped.
  • Method Details

    • copyIdTo

      public final void copyIdTo(Object wrapped)
      Assigns the id value (if non-null) to the given object. This method is typically invoked at unmarshalling time in order to assign the ID of this temporary wrapper to the "real" GeoAPI implementation instance.
      Parameters:
      wrapped - the GeoAPI implementation for which to assign the ID.