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
Author:
Guilhem Legal (Geomatys), Martin Desruisseaux (Geomatys)
  • 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.