Class MD_CharacterSetCode

java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<MD_CharacterSetCode,Charset>
org.apache.sis.internal.jaxb.code.MD_CharacterSetCode

public final class MD_CharacterSetCode extends XmlAdapter<MD_CharacterSetCode,Charset>
JAXB adapter for Charset in order to wrap the value in an XML element as specified by ISO 19115-3 standard. See package documentation for more information about the handling of CodeList in ISO 19115-3.
Since:
0.3
Version:
1.0
  • Field Details

    • identifier

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

    • MD_CharacterSetCode

      public MD_CharacterSetCode()
      Empty constructor for JAXB only.
  • Method Details

    • unmarshal

      public final Charset unmarshal(MD_CharacterSetCode adapter) throws IllegalCharsetNameException
      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<MD_CharacterSetCode,Charset>
      Parameters:
      adapter - the adapter for this metadata value.
      Returns:
      a code list which represents the metadata value.
      Throws:
      IllegalCharsetNameException
    • marshal

      public final MD_CharacterSetCode marshal(Charset 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<MD_CharacterSetCode,Charset>
      Parameters:
      value - the code list value.
      Returns:
      the adapter for the given code list.
    • getElement

      public CodeListUID getElement()
      Invoked by JAXB on marshalling.
      Returns:
      the value to be marshalled.
    • setElement

      public void setElement(CodeListUID value)
      Invoked by JAXB on unmarshalling.
      Parameters:
      value - the unmarshalled value.
    • fromCharset

      public static org.opengis.metadata.identification.CharacterSet fromCharset(Charset cs)
      Converts the given Java Character Set to CharacterSet.
      Parameters:
      cs - the character set, or .
      Returns:
      a code list for the given character set, or null if the given cs was null.