Class Country


public final class Country 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:

Note that <gco:CharacterString> can be substituted to the country code.
Since:
0.3
Version:
1.0
  • Field Details

    • identifier

      private CodeListUID identifier
      The country using a CodeList-like format. This was called "Country" in ISO 19139:2007 and has been renamed "CountryCode" in ISO 19115-3
    • isLegacyMetadata

      private boolean isLegacyMetadata
      true if marshalling ISO 19139:2007, or false if marshalling ISO 19115-3.
  • Constructor Details

    • Country

      private Country()
      Empty constructor for JAXB only.
    • Country

      private Country(CharSequence code)
      Builds a <gco:Country> element. For private use by create(Context, Locale) only.
    • Country

      private Country(Context context, String codeListValue, String codeSpace, String value)
      Builds a <Country> element. For private use by create(Context, Locale) only.
      Parameters:
      context - the current (un)marshalling context, or null if none.
      codeListValue - the codeListValue attribute in the XML element.
      codeSpace - the 3-letters language code of the value attribute, or null if none.
      value - the value in the language specified by the codeSpace attribute, or null if none.
  • Method Details

    • detectVersion

      private void detectVersion()
      Determines if we are marshalling ISO 19139:2007 or ISO 19115-3 documents.
    • getCountry

      private CodeListUID getCountry()
      Gets the value of the Country code using ISO 19139:2007 element name.
    • setCountry

      private void setCountry(CodeListUID newValue)
      Sets the value of the Country code in ISO 19139:2007 element name.
    • getCountryCode

      private CodeListUID getCountryCode()
      Gets the value of the Country code using ISO 19115-3 element name.
    • setCountryCode

      private void setCountryCode(CodeListUID newValue)
      Sets the value of the Country code in ISO 19115-3 element name.
    • create

      public static Country 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 country to marshal, or null if the given locale was null or if its Locale.getCountry() attribute is the empty string.
    • getLocale

      public static Locale getLocale(Context context, LanguageCode language, Country country, Class<?> caller)
      Returns the locale for the given language and country (which may be null), or null if none.
      Parameters:
      context - the current (un)marshalling context, or null if none.
      language - the wrapper for the language value.
      country - the wrapper for the country value.
      caller - the class which is invoking this method, used only in case of warning.
      Returns:
      a locale which represents the language and country value.