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):
LocalName
ScopedName
TypeName
MemberName
- Since:
- 0.3
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Wraps the value only if marshalling ISO 19115-3 element. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.util.GenericName
The generic name to be marshalled. -
Constructor Summary
ConstructorsModifierConstructorDescriptionEmpty constructor for JAXB only.private
GO_GenericName
(org.opengis.util.GenericName value) Wraps a name at marshalling-time. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Ensures that the name is not already defined.final DefaultLocalName
getName()
Returns theTypeName
orMemberName
to marshal.final NameValue
getValue()
Returns theLocalName
orScopedName
to marshal.marshal
(org.opengis.util.GenericName value) Replaces a generic name by its wrapper.final void
setName
(DefaultLocalName value) Sets the value from theTypeName
orMemberName
.final void
Sets the value for theLocalName
orScopedName
.final org.opengis.util.GenericName
unmarshal
(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:
marshal
in 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:
unmarshal
in classXmlAdapter<GO_GenericName,
org.opengis.util.GenericName> - Parameters:
value
- the wrapper, ornull
if none.- Returns:
- the implementing class.
-
getValue
Returns theLocalName
orScopedName
to marshal. Returnsnull
if the name is aTypeName
or aMemberName
, in order to usegetName()
instead. Example:- Returns:
- the code for the current name, or
null
if none.
-
getName
Returns theTypeName
orMemberName
to marshal. Returnsnull
if the name is aLocalName
orScopedName
, in order to usegetValue()
instead. Example:- Returns:
- the current name, or
null
if none.
-
setValue
Sets the value for theLocalName
orScopedName
. 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 theTypeName
orMemberName
. 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.
-