Class CodeListAdapter<BoundType extends org.opengis.util.CodeList<BoundType>>

java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<CodeListAdapter.Value,BoundType>
org.apache.sis.internal.jaxb.gml.CodeListAdapter<BoundType>
Type Parameters:
BoundType - the code list being wrapped.
Direct Known Subclasses:
CD_PixelInCell, CD_VerticalDatumType, CS_AxisDirection, CS_RangeMeaning

public abstract class CodeListAdapter<BoundType extends org.opengis.util.CodeList<BoundType>> extends XmlAdapter<CodeListAdapter.Value,BoundType>
JAXB adapter for GML code lists, in order to integrate the value in an element complying with GML standard. A subclass shall exist for each code list.
Since:
0.3
Version:
0.3
  • Constructor Details

    • CodeListAdapter

      protected CodeListAdapter()
      Empty constructor for subclasses only.
  • Method Details

    • getCodeListClass

      protected abstract Class<BoundType> getCodeListClass()
      Returns the class of code list wrapped by this adapter.
      Returns:
      the code list class.
    • getCodeSpace

      protected String getCodeSpace()
      Returns the default code space for the wrapped code list. The default implementation returns null.
      Returns:
      the default code space, or null.
    • unmarshal

      public final BoundType unmarshal(CodeListAdapter.Value identifier)
      Substitutes the adapter value read from an XML stream by the object which will contain the value. JAXB calls automatically this method at unmarshalling time.
      Specified by:
      unmarshal in class XmlAdapter<CodeListAdapter.Value,BoundType extends org.opengis.util.CodeList<BoundType>>
      Parameters:
      identifier - the code space and identifier.
      Returns:
      a code list which represents the GML value.
    • marshal

      public final CodeListAdapter.Value marshal(BoundType code)
      Substitutes the code list by the proxy to be marshalled into an XML file or stream. JAXB calls automatically this method at marshalling time.
      Specified by:
      marshal in class XmlAdapter<CodeListAdapter.Value,BoundType extends org.opengis.util.CodeList<BoundType>>
      Parameters:
      code - the code list value.
      Returns:
      the proxy for the given code list.