Package org.apache.sis.internal.jaxb.gco
Class CharSequenceAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<GO_CharacterString,CharSequence>
org.apache.sis.internal.jaxb.gco.CharSequenceAdapter
- Direct Known Subclasses:
CharSequenceAdapter.Since2014
JAXB adapter wrapping the string value in a
<gco:CharacterString> element, for ISO 19115-3 compliance.
A CharSequenceAdapter can handle the following types:
InternationalString, which may be mapped toPT_FreeTextelements.String(actually any character sequences other thanInternationalString).Anchor, which can be substituted to any of the above if theReferenceResolverin the current marshalling context maps the given text to axlink.
- Since:
- 0.3
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWraps the value only if marshalling ISO 19115-3 element. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionmarshal(CharSequence value) Converts a character sequence to the object to be marshalled in a XML file or stream.final CharSequenceunmarshal(GO_CharacterString value) Converts a string read from a XML stream to the object containing the value.static CharSequenceSame aswrap(Context, Object, String), but returns directly theGO_CharacterString.textvalue without wrapping in aGO_CharacterStringinstance.(package private) static GO_CharacterStringwrap(CharSequence value) Converts a character sequence to the object to be marshalled in a XML file or stream.static GO_CharacterStringConverts the string representation of an object to be marshalled in a XML file or stream.
-
Constructor Details
-
CharSequenceAdapter
public CharSequenceAdapter()Constructor for JAXB only.
-
-
Method Details
-
unmarshal
Converts a string read from a XML stream to the object containing the value. JAXB calls automatically this method at unmarshalling time.- Specified by:
unmarshalin classXmlAdapter<GO_CharacterString,CharSequence> - Parameters:
value- the adapter for this metadata value.- Returns:
- a
CharSequencewhich represents the metadata value.
-
marshal
Converts a character sequence to the object to be marshalled in a XML file or stream. JAXB calls automatically this method at marshalling time.- Specified by:
marshalin classXmlAdapter<GO_CharacterString,CharSequence> - Parameters:
value- the string value.- Returns:
- the wrapper for the given character sequence, or
null.
-
wrap
Converts a character sequence to the object to be marshalled in a XML file or stream.- Parameters:
value- the character representation of the object being marshalled.- Returns:
- the wrapper for the given character sequence, or
null.
-
wrap
Converts the string representation of an object to be marshalled in a XML file or stream. This method is a copy ofwrap(CharSequence)simplified for the case when we know that the character sequence being marshalled is a string.- Parameters:
context- the current (un)marshalling context, ornullif none.object- the object being marshalled (e.g.URIorLocale).string- the string representation of the object being marshalled.- Returns:
- the wrapper for the given character sequence, or
null.
-
value
Same aswrap(Context, Object, String), but returns directly theGO_CharacterString.textvalue without wrapping in aGO_CharacterStringinstance.- Parameters:
context- the current (un)marshalling context, ornullif none.object- the object being marshalled (e.g.URIorLocale).string- the string representation of the object being marshalled.- Returns:
- the text value for the given character sequence, or
null.
-