Class UnsupportedCodeListAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>>

java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,org.opengis.util.CodeList<?>>
org.apache.sis.internal.geoapi.evolution.UnsupportedCodeListAdapter<ValueType>
Type Parameters:
ValueType - The subclass implementing this adapter.
Direct Known Subclasses:
CI_TelephoneTypeCode, DCPList, SV_CouplingType

public abstract class UnsupportedCodeListAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>> extends XmlAdapter<ValueType,org.opengis.util.CodeList<?>>
An adapter for UnsupportedCodeList, in order to implement the ISO 19115-3 standard. See CodeListAdapter for more information.
Since:
0.5
Version:
0.5
  • Field Details

    • identifier

      protected CodeListUID identifier
      The value of the CodeList.
  • Constructor Details

    • UnsupportedCodeListAdapter

      protected UnsupportedCodeListAdapter()
      Empty constructor for subclasses only.
    • UnsupportedCodeListAdapter

      protected UnsupportedCodeListAdapter(CodeListUID value)
      Creates a wrapper for a CodeList, in order to handle the format specified in ISO-19139.
      Parameters:
      value - the value of the CodeList to be marshalled.
  • Method Details

    • wrap

      protected abstract ValueType wrap(CodeListUID value)
      Wraps the code into an adapter. Most implementations will be like below:
      Parameters:
      value - the value of CodeList to be marshalled.
      Returns:
      the wrapper for the code list value.
    • getCodeListName

      protected abstract String getCodeListName()
      Returns the name of the code list class.
      Returns:
      the code list class name.
    • unmarshal

      public final org.opengis.util.CodeList<?> unmarshal(ValueType adapter)
      Substitutes the adapter value read from an XML stream by the object which will contains the value. JAXB calls automatically this method at unmarshalling time.
      Specified by:
      unmarshal in class XmlAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>,org.opengis.util.CodeList<?>>
      Parameters:
      adapter - the adapter for this metadata value.
      Returns:
      a code list which represents the metadata value.
    • marshal

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

      protected String toIdentifier(String name, StringBuilder buffer, boolean isValue)
      Converts the given Java constant name to something hopefully close to the UML identifier, or close to the textual value to put in the XML. This method convert the Java constant name to camel case if isValue is true, or to lower cases with word separated by spaces if isValue is true.
      Parameters:
      name - The Java constant name (e.g. WEB_SERVICES).
      buffer - An initially empty buffer to use for creating the identifier.
      isValue - false for the codeListValue attribute, or true for the XML value.
      Returns:
      The identifier (e.g. "webServices" or "Web services").
    • getElement

      public abstract CodeListUID getElement()
      Invoked by JAXB on marshalling. Subclasses must override this method with the appropriate @XmlElement annotation.
      Returns:
      The CodeList value to be marshalled.