Class TextGroup

java.lang.Object
org.apache.sis.internal.jaxb.lan.TextGroup

final class TextGroup extends Object
A set of strings localized in different languages. This adapter represents the <lan:textGroup> element defined in ISO 19139:2007. See PT_FreeText class javadoc for an example.

If a localized string has a null locale, then this string will not be included in this text group because that string should be already included in the <gco:CharacterString> element of the parent PT_FreeText (at least in default behavior - actually the above may not be true anymore if the marshaller XML.LOCALE property has been set).

The TextGroup name suggests that this object can contain many localized strings. However, it appears that despite its name, TextGroup shall always contains exactly 1 localized strings and the whole TextGroup element shall be repeated for each additional languages. SIS uses the ISO 19139:2007 compliant form for marshalling, but accepts both forms during unmarshalling. More specifically, the name suggests that the format should be:

But the actual official format is:
Since:
0.3
Version:
1.0
See Also:
  • Field Details

    • localized

      protected LocalisedCharacterString[] localized
      The set of localized string. JAXB uses this field at marshalling-time in order to wrap N <LocalisedCharacterString> elements inside a single <textGroup> element.

      In ISO 19139:2007 compliant documents, the length of this array shall be exactly 1, as in the second example of class javadoc. However, SIS allows arbitrary length (as in the first example of class javadoc) for compatibility and convenience reasons.

  • Constructor Details

    • TextGroup

      public TextGroup()
      Empty constructor only used by JAXB.
    • TextGroup

      TextGroup(Locale locale, String text)
      Constructs a text group for a single locale. This constructor puts exactly one string in the TextGroup, as required by ISO 19139:2007. However, it would be possible to declare another constructor allowing the more compact form (the smaller) if there is a need for that in the future.
      Parameters:
      locale - the string language.
      text - the string.
  • Method Details