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 CodeListUIDThe country using aCodeList-like format.private booleantrueif marshalling ISO 19139:2007, orfalseif 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 CountryCreates a new wrapper for the given locale.private voidDetermines if we are marshalling ISO 19139:2007 or ISO 19115-3 documents.private CodeListUIDGets the value of the Country code using ISO 19139:2007 element name.private CodeListUIDGets the value of the Country code using ISO 19115-3 element name.static LocalegetLocale(Context context, LanguageCode language, Country country, Class<?> caller) Returns the locale for the given language and country (which may be null), ornullif none.private voidsetCountry(CodeListUID newValue) Sets the value of the Country code in ISO 19139:2007 element name.private voidsetCountryCode(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 isLegacyMetadatatrueif marshalling ISO 19139:2007, orfalseif 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, 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
-
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, ornullif none.locale- the value to marshal, ornull.- Returns:
- the country to marshal, or
nullif 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), ornullif none.- Parameters:
context- the current (un)marshalling context, ornullif 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.
-