Package org.apache.sis.internal.jaxb.lan
Class PT_Locale
java.lang.Object
org.apache.sis.internal.jaxb.lan.PT_Locale
A
Locale associated to Charset.
This class wraps 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 wrapper formats the locale like below:
For an alternative (simpler) format used in the legacy gmd namespace, see LocaleAdapter.- Since:
- 0.3
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classA set ofPT_Localeinstances backed by aMap<Locale,Charset>.private static final classWraps the"locale"attributes in a"PT_Locale"element. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PT_Locale.WrapperThe attributes wrapped in a"PT_Locale"element.private LocaleThe wrapped locale, for information purpose. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final booleanInfers a locale and character set from this wrapper and adds them as an entry in the given map.static PT_LocaleReturns the first element of the given map, ornullif none.(package private) final CharsetReturns the character set, ornullif none.Returns the Java locale wrapped by thisPT_Localeinstance.(package private) final voidsetCharacterSet(Charset encoding) Sets the character set to the given value.Wraps all elements of the given map in a sequence ofPT_Locale.
-
Field Details
-
locale
The wrapped locale, for information purpose. This object is not marshalled directly. Instead, it will be decomposed in language and country components inPT_Locale.Wrapper.- See Also:
-
element
The attributes wrapped in a"PT_Locale"element.
-
-
Constructor Details
-
PT_Locale
private PT_Locale()Empty constructor for JAXB only. -
PT_Locale
Creates a new wrapper for the given locale.- Parameters:
locale- the language and country components ofPT_Locale.
-
PT_Locale
Creates a new wrapper for the given locale and character set.- Parameters:
entry- the locale to marshal together with its charset.
-
-
Method Details
-
getLocale
Returns the Java locale wrapped by thisPT_Localeinstance. This method returns a cached instance if possible.- Returns:
- the wrapped locale, or
nullif none.
-
getCharacterSet
Returns the character set, ornullif none. -
setCharacterSet
Sets the character set to the given value. -
addInto
Infers a locale and character set from this wrapper and adds them as an entry in the given map.- Parameters:
addTo- the map where to add an entry for the locale and character set.- Returns:
- whether the given map has been modified.
-
first
Returns the first element of the given map, ornullif none.- Parameters:
locales- the locales and character sets, ornull.- Returns:
- the first element of the given map, or
null.
-
wrap
Wraps all elements of the given map in a sequence ofPT_Locale.- Parameters:
locales- the locales and character sets, ornull.- Returns:
- the all elements of the given map, or
nullif the given map is null or empty.
-