Class LanguageCode

java.lang.Object
org.apache.sis.internal.jaxb.gco.GO_CharacterString
org.apache.sis.internal.jaxb.lan.LanguageCode

public final class LanguageCode extends GO_CharacterString
JAXB wrapper for Locale 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.

This adapter formats the locale like below (by LocaleAdapter):

or (when using PT_Locale adapter): Note that <gco:CharacterString> can be substituted to the language code.
Since:
0.3
Version:
1.0
Author:
Cédric Briançon (Geomatys), Martin Desruisseaux (Geomatys), Cullen Rombach (Image Matters)
  • Method Details

    • create

      public static LanguageCode create(Context context, Locale locale)
      Creates a new wrapper for the given locale.
      Parameters:
      context - the current (un)marshalling context, or null if none.
      locale - the value to marshal, or null.
      Returns:
      the language to marshal, or null if the given locale was null or if its Locale.getLanguage() attribute is the empty string.
    • getLanguage

      public String getLanguage()
      Returns the language, or null if none. The language is expected to be a 2- or 3-letters ISO 639 code, but this is not verified by this method.
      Returns:
      the language code