Package org.apache.sis.internal.jaxb.gco
Class GO_GenericName
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<GO_GenericName,org.opengis.util.GenericName>
org.apache.sis.internal.jaxb.gco.GO_GenericName
- Direct Known Subclasses:
GO_GenericName.Since2014
JAXB wrapper in order to map implementing class with the GeoAPI interface.
This adapter is used for all the following mutually exclusive properties
(only one can be defined at time):
LocalNameScopedNameTypeNameMemberName
- Since:
- 0.3
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classWraps the value only if marshalling ISO 19115-3 element. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.util.GenericNameThe generic name to be marshalled. -
Constructor Summary
ConstructorsModifierConstructorDescriptionEmpty constructor for JAXB only.privateGO_GenericName(org.opengis.util.GenericName value) Wraps a name at marshalling-time. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidEnsures that the name is not already defined.final DefaultLocalNamegetName()Returns theTypeNameorMemberNameto marshal.final NameValuegetValue()Returns theLocalNameorScopedNameto marshal.marshal(org.opengis.util.GenericName value) Replaces a generic name by its wrapper.final voidsetName(DefaultLocalName value) Sets the value from theTypeNameorMemberName.final voidSets the value for theLocalNameorScopedName.final org.opengis.util.GenericNameunmarshal(GO_GenericName value) Unwraps the generic name from the given element.
-
Field Details
-
name
private org.opengis.util.GenericName nameThe generic name to be marshalled.
-
-
Constructor Details
-
GO_GenericName
public GO_GenericName()Empty constructor for JAXB only. -
GO_GenericName
private GO_GenericName(org.opengis.util.GenericName value) Wraps a name at marshalling-time.
-
-
Method Details
-
marshal
Replaces a generic name by its wrapper. JAXB calls automatically this method at marshalling-time.- Specified by:
marshalin classXmlAdapter<GO_GenericName,org.opengis.util.GenericName> - Parameters:
value- the implementing class for this metadata value.- Returns:
- an wrapper which contains the metadata value.
-
unmarshal
Unwraps the generic name from the given element. JAXB calls automatically this method at unmarshalling-time.- Specified by:
unmarshalin classXmlAdapter<GO_GenericName,org.opengis.util.GenericName> - Parameters:
value- the wrapper, ornullif none.- Returns:
- the implementing class.
-
getValue
Returns theLocalNameorScopedNameto marshal. Returnsnullif the name is aTypeNameor aMemberName, in order to usegetName()instead. Example:- Returns:
- the code for the current name, or
nullif none.
-
getName
Returns theTypeNameorMemberNameto marshal. Returnsnullif the name is aLocalNameorScopedName, in order to usegetValue()instead. Example:- Returns:
- the current name, or
nullif none.
-
setValue
Sets the value for theLocalNameorScopedName. This method is called at unmarshalling-time by JAXB.- Parameters:
code- the new name.- Throws:
IllegalStateException- if a name is already defined.
-
setName
Sets the value from theTypeNameorMemberName. This method is called at unmarshalling-time by JAXB.- Parameters:
value- the new name.- Throws:
IllegalStateException- if a name is already defined.
-
ensureUndefined
Ensures that the name is not already defined.- Throws:
IllegalStateException- if a name is already defined.
-