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
ConstructorsModifierConstructorDescriptionprivateEmpty constructor used only by JAXB.privatePT_FreeText(String text, TextGroup[] textGroup) Constructs aPT_FreeTextcontaining the given text groups. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanReturnstrueif thisPT_FreeTextcontains the given localized text.static PT_FreeTextcreate(org.opengis.util.InternationalString text) Constructs a text group from the givenInternationalStringif it contains at least one non-root locale.protected CharSequenceReturns 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_FreeTextcontaining 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 theTextGroupconstructor works better if the<gco:CharacterString>have been set for theROOTlocale (the default behavior). If a different locale were set, the list of localized strings inTextGroupmay 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 givenInternationalStringif it contains at least one non-root locale. Otherwise returnsnull, meaning that the simplerGO_CharacterStringconstruct should be used instead.- Parameters:
text- an international string which could have several translations embedded for the same text.- Returns:
- a
PT_FreeTextinstance if the given text has several translations, ornullotherwise.
-
contains
Returnstrueif thisPT_FreeTextcontains the given localized text. This method searches only in the localized text. The content of theGO_CharacterString.textfield 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.textvalue).- Returns:
trueif the given text has been found.
-
toCharSequence
Returns the content of this<gco:CharacterString>as anInternationalString.- Overrides:
toCharSequencein classGO_CharacterString- Returns:
- the character sequence for this
<gco:CharacterString>.
-