Package org.apache.sis.internal.jaxb.gco
Class GO_CharacterString
java.lang.Object
org.apache.sis.internal.jaxb.gco.GO_CharacterString
- Direct Known Subclasses:
Country,LanguageCode,PT_FreeText
JAXB wrapper for string value in a
<gco:CharacterString>, <gcx:Anchor>,
<gcx:FileName> or <gcx:MimeFileType> element, for ISO 19115-3 compliance.
FileName and MimeFileType are possible substitutions for CharacterString.
They make sense only in DefaultBrowseGraphic or
other classes using URI, but the XML schema does not prevent their usage in place of other strings.
Consequently, we unconditionally accept FileName and MimeFileType at unmarshalling time.
However, marshalling will use the appropriate element for the kind of property to marshal.
<gco:CharacterString> can also be replaced by CodeList or some
Enum instances. See Types javadoc for an example.
- Since:
- 0.3
- Version:
- 1.0
- Author:
- Cédric Briançon (Geomatys), Martin Desruisseaux (Geomatys), Cullen Rombach (Image Matters)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteValue assigned totypeif the character string shall be marshalled as a<gcx:FileName>element.static final byteValue assigned totypeif the character string shall be marshalled as a<gcx:MimeFileType>element.byte0 if the text shall be marshalled as a<gco:CharacterString>, or one of the static constants in this class otherwise.static final byteValue assigned totypeif the character string shall be marshalled as a legacy<gmd:URL>element. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEmpty constructor for JAXB and subclasses.protectedBuilds a wrapper for the given text. -
Method Summary
Modifier and TypeMethodDescriptionprotected CharSequenceReturns the content of this<gco:CharacterString>as aString, anInternationalStringor anAnchor.final StringtoString()Returns the text as a string, ornullif none.
-
Field Details
-
MIME_TYPE
public static final byte MIME_TYPEValue assigned totypeif the character string shall be marshalled as a<gcx:MimeFileType>element.- See Also:
-
FILENAME
public static final byte FILENAMEValue assigned totypeif the character string shall be marshalled as a<gcx:FileName>element.- See Also:
-
URL
public static final byte URLValue assigned totypeif the character string shall be marshalled as a legacy<gmd:URL>element.- See Also:
-
type
public byte type0 if the text shall be marshalled as a<gco:CharacterString>, or one of the static constants in this class otherwise.- See Also:
-
-
Constructor Details
-
GO_CharacterString
protected GO_CharacterString()Empty constructor for JAXB and subclasses. -
GO_CharacterString
Builds a wrapper for the given text.- Parameters:
text- the string to marshal, ornullif none.
-
-
Method Details
-
toCharSequence
Returns the content of this<gco:CharacterString>as aString, anInternationalStringor anAnchor. This method is overridden byPT_FreeTextin order to handle the international string case.- Returns:
- the character sequence for this
<gco:CharacterString>.
-
toString
Returns the text as a string, ornullif none. The null value is expected by variousPT_FreeText.Note: Returningnullis unusual and not a recommended practice. But precedents exist (for exampleDefaultMutableTreeNode) and this class is not for public usage.
-