Class UnsupportedCodeListAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>>
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<ValueType,org.opengis.util.CodeList<?>>
org.apache.sis.internal.geoapi.evolution.UnsupportedCodeListAdapter<ValueType>
- Type Parameters:
ValueType
- The subclass implementing this adapter.
- Direct Known Subclasses:
CI_TelephoneTypeCode
,DCPList
,SV_CouplingType
public abstract class UnsupportedCodeListAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>>
extends XmlAdapter<ValueType,org.opengis.util.CodeList<?>>
An adapter for
UnsupportedCodeList
, in order to implement the ISO 19115-3 standard.
See CodeListAdapter
for more information.- Since:
- 0.5
- Version:
- 0.5
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Empty constructor for subclasses only.protected
Creates a wrapper for aCodeList
, in order to handle the format specified in ISO-19139. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract String
Returns the name of the code list class.abstract CodeListUID
Invoked by JAXB on marshalling.final ValueType
marshal
(org.opengis.util.CodeList<?> value) Substitutes the code list by the adapter to be marshalled into an XML file or stream.protected String
toIdentifier
(String name, StringBuilder buffer, boolean isValue) Converts the given Java constant name to something hopefully close to the UML identifier, or close to the textual value to put in the XML.final org.opengis.util.CodeList<?>
Substitutes the adapter value read from an XML stream by the object which will contains the value.protected abstract ValueType
wrap
(CodeListUID value) Wraps the code into an adapter.
-
Field Details
-
identifier
The value of theCodeList
.
-
-
Constructor Details
-
UnsupportedCodeListAdapter
protected UnsupportedCodeListAdapter()Empty constructor for subclasses only. -
UnsupportedCodeListAdapter
Creates a wrapper for aCodeList
, in order to handle the format specified in ISO-19139.- Parameters:
value
- the value of theCodeList
to be marshalled.
-
-
Method Details
-
wrap
Wraps the code into an adapter. Most implementations will be like below:- Parameters:
value
- the value ofCodeList
to be marshalled.- Returns:
- the wrapper for the code list value.
-
getCodeListName
Returns the name of the code list class.- Returns:
- the code list class name.
-
unmarshal
Substitutes the adapter value read from an XML stream by the object which will contains the value. JAXB calls automatically this method at unmarshalling time.- Specified by:
unmarshal
in classXmlAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>,
org.opengis.util.CodeList<?>> - Parameters:
adapter
- the adapter for this metadata value.- Returns:
- a code list which represents the metadata value.
-
marshal
Substitutes the code list by the adapter to be marshalled into an XML file or stream. JAXB calls automatically this method at marshalling time.- Specified by:
marshal
in classXmlAdapter<ValueType extends UnsupportedCodeListAdapter<ValueType>,
org.opengis.util.CodeList<?>> - Parameters:
value
- the code list value.- Returns:
- the adapter for the given code list.
-
toIdentifier
Converts the given Java constant name to something hopefully close to the UML identifier, or close to the textual value to put in the XML. This method convert the Java constant name to camel case ifisValue
istrue
, or to lower cases with word separated by spaces ifisValue
istrue
.- Parameters:
name
- The Java constant name (e.g.WEB_SERVICES
).buffer
- An initially empty buffer to use for creating the identifier.isValue
-false
for thecodeListValue
attribute, ortrue
for the XML value.- Returns:
- The identifier (e.g.
"webServices"
or"Web services"
).
-
getElement
Invoked by JAXB on marshalling. Subclasses must override this method with the appropriate@XmlElement
annotation.- Returns:
- The
CodeList
value to be marshalled.
-