Class LocaleAdapter


public final class LocaleAdapter extends XmlAdapter<LanguageCode,Locale>
JAXB adapter for XML <GO_CharacterString> or <LanguageCode> elements mapped to Locale. This adapter formats the locale like below: This adapter is used for legacy locales in gmd namespace. For locales in the newer lan namespace, see PT_Locale.
Since:
0.3
Version:
0.4
See Also:
  • Constructor Details

    • LocaleAdapter

      private LocaleAdapter()
      Empty constructor for JAXB.
  • Method Details

    • unmarshal

      public Locale unmarshal(LanguageCode value)
      Converts the locale read from a XML stream to the object containing the value. JAXB calls automatically this method at unmarshalling time.
      Specified by:
      unmarshal in class XmlAdapter<LanguageCode,Locale>
      Parameters:
      value - the adapter for this metadata value.
      Returns:
      a locale which represents the metadata value.
    • marshal

      public LanguageCode marshal(Locale value)
      Converts the locale to the object to be marshalled in a XML file or stream. JAXB calls automatically this method at marshalling time.
      Specified by:
      marshal in class XmlAdapter<LanguageCode,Locale>
      Parameters:
      value - the locale value.
      Returns:
      the adapter for the given locale.