Class PT_Locale.Wrapper

java.lang.Object
org.apache.sis.internal.jaxb.lan.PT_Locale.Wrapper
Enclosing class:
PT_Locale

private static final class PT_Locale.Wrapper extends Object
Wraps the "locale" attributes in a "PT_Locale" element.
  • Field Details

    • language

      LanguageCode language
      The language code, or null if none.
    • country

      Country country
      The country code, or null if none.
    • characterEncoding

      Charset characterEncoding
      The character encoding. If null, then this property will be set to the encoding of XML file. The specification said:
      Indeed, an XML file can only support data expressed in a single character set, which is generally declared in the XML file header. Having all the localized strings stored in a single XML file would limit the use of a single character set such as UTF-8. In order to avoid this, the LocalisedCharacterString class is implemented specifically to allow a by-reference containment of the PT_FreeText.textGroup property, and the PT_LocaleContainer is the recommended root element to be instantiated in a dedicated XML file. The localized string related to a given locale can be stored in a corresponding locale container (i.e. XML file) and referenced from the PT_FreeText.textGroup property instances.
    • isLegacyMetadata

      private boolean isLegacyMetadata
      true if marshalling an element from the ISO 19115:2003 model, or false if marshalling an element from the ISO 19115:2014 model.
  • Constructor Details

    • Wrapper

      public Wrapper()
      Empty constructor for JAXB only.
    • Wrapper

      Wrapper(Locale locale, Charset encoding)
      Creates a new wrapper for the given locale.
      Parameters:
      locale - the locale to marshal, or null.
      encoding - the character set, or null for defaulting to the encoding of XML document.
  • Method Details

    • getLanguageCode

      private LanguageCode getLanguageCode()
      Gets the language code for this PT_Locale. Used in ISO 19115:2003 model.
    • setLanguageCode

      private void setLanguageCode(LanguageCode newValue)
      Sets the language code for this PT_Locale. Used in ISO 19115:2003 model.
    • getLanguage

      private LanguageCode getLanguage()
      Gets the language code for this PT_Locale. Used in ISO 19115:2014 model.
    • setLanguage

      private void setLanguage(LanguageCode newValue)
      Sets the language code for this PT_Locale. Used in ISO 19115:2014 model.
    • beforeMarshal

      public void beforeMarshal(Marshaller marshaller)
      Invoked by JAXB Marshaller before this object is marshalled to XML. If the characterEncoding is not set, then this method set a default value. That default is the encoding of the XML document being written.
      Note: This is redundant with the encoding declared in the XML header. But the <lan:characterEncoding> element is mandatory according OGC/ISO schemas.