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
ConstructorsModifierConstructorDescriptionprivate
Empty constructor for JAXB only.private
LanguageCode
(CharSequence code) Builds a<gco:LanguageCode>
element.private
LanguageCode
(Context context, String codeListValue, String codeSpace, String value) Builds a<LanguageCode>
element. -
Method Summary
Modifier and TypeMethodDescriptionstatic LanguageCode
Creates a new wrapper for the given locale.Returns the language, ornull
if none.(package private) static Locale
marshalLocale
(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, ornull
if none.codeListValue
- thecodeListValue
attribute in the XML element.codeSpace
- the 3-letters language code of thevalue
attribute, ornull
if none.value
- the value in the language specified by thecodeSpace
attribute, ornull
if none.
-
-
Method Details
-
create
Creates a new wrapper for the given locale.- Parameters:
context
- the current (un)marshalling context, ornull
if none.locale
- the value to marshal, ornull
.- Returns:
- the language to marshal, or
null
if 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, ornull
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
-