Package org.apache.sis.internal.jaxb.lan
Class PT_Locale.Wrapper
java.lang.Object
org.apache.sis.internal.jaxb.lan.PT_Locale.Wrapper
- Enclosing class:
PT_Locale
Wraps the
"locale"
attributes in a "PT_Locale"
element.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Charset
The character encoding.(package private) Country
The country code, ornull
if none.private boolean
true
if marshalling an element from the ISO 19115:2003 model, orfalse
if marshalling an element from the ISO 19115:2014 model.(package private) LanguageCode
The language code, ornull
if none. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
beforeMarshal
(Marshaller marshaller) Invoked by JAXBMarshaller
before this object is marshalled to XML.private LanguageCode
Gets the language code for this PT_Locale.private LanguageCode
Gets the language code for this PT_Locale.private void
setLanguage
(LanguageCode newValue) Sets the language code for this PT_Locale.private void
setLanguageCode
(LanguageCode newValue) Sets the language code for this PT_Locale.
-
Field Details
-
language
LanguageCode languageThe language code, ornull
if none. -
country
Country countryThe country code, ornull
if none. -
characterEncoding
Charset characterEncodingThe character encoding. Ifnull
, then this property will be set to the encoding of XML file. The specification said:Indeed, an XML file can only support data expressed in a single character set, which is generally declared in the XML file header. Having all the localized strings stored in a single XML file would limit the use of a single character set such as UTF-8. In order to avoid this, the
LocalisedCharacterString
class is implemented specifically to allow a by-reference containment of thePT_FreeText.textGroup
property, and thePT_LocaleContainer
is the recommended root element to be instantiated in a dedicated XML file. The localized string related to a given locale can be stored in a corresponding locale container (i.e. XML file) and referenced from thePT_FreeText.textGroup
property instances. -
isLegacyMetadata
private boolean isLegacyMetadatatrue
if marshalling an element from the ISO 19115:2003 model, orfalse
if marshalling an element from the ISO 19115:2014 model.
-
-
Constructor Details
-
Wrapper
public Wrapper()Empty constructor for JAXB only. -
Wrapper
Creates a new wrapper for the given locale.- Parameters:
locale
- the locale to marshal, ornull
.encoding
- the character set, ornull
for defaulting to the encoding of XML document.
-
-
Method Details
-
getLanguageCode
Gets the language code for this PT_Locale. Used in ISO 19115:2003 model. -
setLanguageCode
Sets the language code for this PT_Locale. Used in ISO 19115:2003 model. -
getLanguage
Gets the language code for this PT_Locale. Used in ISO 19115:2014 model. -
setLanguage
Sets the language code for this PT_Locale. Used in ISO 19115:2014 model. -
beforeMarshal
Invoked by JAXBMarshaller
before this object is marshalled to XML. If thecharacterEncoding
is not set, then this method set a default value. That default is the encoding of the XML document being written.Note: This is redundant with the encoding declared in the XML header. But the<lan:characterEncoding>
element is mandatory according OGC/ISO schemas.
-