Package org.apache.sis.internal.jaxb.lan
Class Country
java.lang.Object
org.apache.sis.internal.jaxb.gco.GO_CharacterString
org.apache.sis.internal.jaxb.lan.Country
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 Summary
FieldsModifier and TypeFieldDescriptionprivate CodeListUID
The country using aCodeList
-like format.private boolean
true
if marshalling ISO 19139:2007, orfalse
if marshalling ISO 19115-3.Fields inherited from class org.apache.sis.internal.jaxb.gco.GO_CharacterString
FILENAME, MIME_TYPE, type, URL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Country
Creates a new wrapper for the given locale.private void
Determines if we are marshalling ISO 19139:2007 or ISO 19115-3 documents.private CodeListUID
Gets the value of the Country code using ISO 19139:2007 element name.private CodeListUID
Gets the value of the Country code using ISO 19115-3 element name.static Locale
getLocale
(Context context, LanguageCode language, Country country, Class<?> caller) Returns the locale for the given language and country (which may be null), ornull
if none.private void
setCountry
(CodeListUID newValue) Sets the value of the Country code in ISO 19139:2007 element name.private void
setCountryCode
(CodeListUID newValue) Sets the value of the Country code in ISO 19115-3 element name.Methods inherited from class org.apache.sis.internal.jaxb.gco.GO_CharacterString
toCharSequence, toString
-
Field Details
-
identifier
The country using aCodeList
-like format. This was called "Country" in ISO 19139:2007 and has been renamed "CountryCode" in ISO 19115-3 -
isLegacyMetadata
private boolean isLegacyMetadatatrue
if marshalling ISO 19139:2007, orfalse
if marshalling ISO 19115-3.
-
-
Constructor Details
-
Country
private Country()Empty constructor for JAXB only. -
Country
Builds a<gco:Country>
element. For private use bycreate(Context, Locale)
only. -
Country
Builds a<Country>
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
-
detectVersion
private void detectVersion()Determines if we are marshalling ISO 19139:2007 or ISO 19115-3 documents. -
getCountry
Gets the value of the Country code using ISO 19139:2007 element name. -
setCountry
Sets the value of the Country code in ISO 19139:2007 element name. -
getCountryCode
Gets the value of the Country code using ISO 19115-3 element name. -
setCountryCode
Sets the value of the Country code in ISO 19115-3 element name. -
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 country to marshal, or
null
if the given locale was null or if itsLocale.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), ornull
if none.- Parameters:
context
- the current (un)marshalling context, ornull
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.
-