Package org.apache.sis.internal.jaxb.lan
Class LanguageCode
java.lang.Object
org.apache.sis.internal.jaxb.gco.GO_CharacterString
org.apache.sis.internal.jaxb.lan.LanguageCode
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):
PT_Locale adapter):
Note that <gco:CharacterString> can be substituted to the language code.- Since:
- 0.3
- Version:
- 1.0
-
Field Summary
FieldsFields inherited from class org.apache.sis.internal.jaxb.gco.GO_CharacterString
FILENAME, MIME_TYPE, type, URL -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateEmpty constructor for JAXB only.privateLanguageCode(CharSequence code) Builds a<gco:LanguageCode>element.privateLanguageCode(Context context, String codeListValue, String codeSpace, String value) Builds a<LanguageCode>element. -
Method Summary
Modifier and TypeMethodDescriptionstatic LanguageCodeCreates a new wrapper for the given locale.Returns the language, ornullif none.(package private) static LocalemarshalLocale(Context context) Returns the locale to use at marshalling time, or the default locale if unspecified.Methods inherited from class org.apache.sis.internal.jaxb.gco.GO_CharacterString
toCharSequence, toString
-
Field Details
-
identifier
The language using aCodeList-like format.
-
-
Constructor Details
-
LanguageCode
private LanguageCode()Empty constructor for JAXB only. -
LanguageCode
Builds a<gco:LanguageCode>element. For private use bycreate(Context, Locale)only. -
LanguageCode
Builds a<LanguageCode>element. For private use bycreate(Context, Locale)only.- Parameters:
context- the current (un)marshalling context, ornullif none.codeListValue- thecodeListValueattribute in the XML element.codeSpace- the 3-letters language code of thevalueattribute, ornullif none.value- the value in the language specified by thecodeSpaceattribute, ornullif none.
-
-
Method Details
-
create
Creates a new wrapper for the given locale.- Parameters:
context- the current (un)marshalling context, ornullif none.locale- the value to marshal, ornull.- Returns:
- the language to marshal, or
nullif the given locale was null or if itsLocale.getLanguage()attribute is the empty string.
-
marshalLocale
Returns the locale to use at marshalling time, or the default locale if unspecified. -
getLanguage
Returns the language, ornullif 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
-