Package org.apache.sis.internal.jaxb.lan
Class PT_FreeText
java.lang.Object
org.apache.sis.internal.jaxb.gco.GO_CharacterString
org.apache.sis.internal.jaxb.lan.PT_FreeText
JAXB wrapper for ISO 19115-3
<PT_FreeText>
element mapped to InternationalString
.
It will be used in order to marshal and unmarshal international strings localized in several language,
using the DefaultInternationalString
implementation class. Example:
If there is more than one locale, the whole <lan:textGroup>
block is repeated for each
locale, instead of repeating <lan:LocalisedCharacterString>
inside the same group as
we could expect. However, at unmarshalling time, both forms are accepted.
The <gco:CharacterString>
element is inherited from the GO_CharacterString
parent class.
- Since:
- 0.3
- Version:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TextGroup[]
A set ofLocalisedCharacterString
, representing the<lan:textGroup>
element.Fields inherited from class org.apache.sis.internal.jaxb.gco.GO_CharacterString
FILENAME, MIME_TYPE, type, URL
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Empty constructor used only by JAXB.private
PT_FreeText
(String text, TextGroup[] textGroup) Constructs aPT_FreeText
containing the given text groups. -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
Returnstrue
if thisPT_FreeText
contains the given localized text.static PT_FreeText
create
(org.opengis.util.InternationalString text) Constructs a text group from the givenInternationalString
if it contains at least one non-root locale.protected CharSequence
Returns the content of this<gco:CharacterString>
as anInternationalString
.Methods inherited from class org.apache.sis.internal.jaxb.gco.GO_CharacterString
toString
-
Field Details
-
textGroup
A set ofLocalisedCharacterString
, representing the<lan:textGroup>
element. The array shall contain one element for each locale.
-
-
Constructor Details
-
PT_FreeText
private PT_FreeText()Empty constructor used only by JAXB. -
PT_FreeText
Constructs aPT_FreeText
containing the given text groups.The
<gco:CharacterString>
element will typically be set for theLocale.ROOT
, which is the "unlocalized" string (not the same thing than the string in the default locale). Note that theTextGroup
constructor works better if the<gco:CharacterString>
have been set for theROOT
locale (the default behavior). If a different locale were set, the list of localized strings inTextGroup
may contains an element which duplicate the<gco:CharacterString>
element, or the unlocalized string normally written in<gco:CharacterString>
may be missing.- Parameters:
text
- the text to write in the<gco:CharacterString>
element.textGroup
- the text group elements.- See Also:
-
-
Method Details
-
create
Constructs a text group from the givenInternationalString
if it contains at least one non-root locale. Otherwise returnsnull
, meaning that the simplerGO_CharacterString
construct should be used instead.- Parameters:
text
- an international string which could have several translations embedded for the same text.- Returns:
- a
PT_FreeText
instance if the given text has several translations, ornull
otherwise.
-
contains
Returnstrue
if thisPT_FreeText
contains the given localized text. This method searches only in the localized text. The content of theGO_CharacterString.text
field is intentionally omitted since it is usually the text we are searching for! (this method is used for detecting duplicated values).- Parameters:
search
- the text to search (usually theGO_CharacterString.text
value).- Returns:
true
if the given text has been found.
-
toCharSequence
Returns the content of this<gco:CharacterString>
as anInternationalString
.- Overrides:
toCharSequence
in classGO_CharacterString
- Returns:
- the character sequence for this
<gco:CharacterString>
.
-