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

public class GO_GenericName extends XmlAdapter<GO_GenericName,org.opengis.util.GenericName>
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
Note that there is no need to create adapter for above-cited subtypes. This adapter should be applicable to all.
Since:
0.3
Version:
1.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Wraps the value only if marshalling ISO 19115-3 element.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.opengis.util.GenericName
    The generic name to be marshalled.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    Empty constructor for JAXB only.
    private
    GO_GenericName(org.opengis.util.GenericName value)
    Wraps a name at marshalling-time.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    Ensures that the name is not already defined.
    Returns the TypeName or MemberName to marshal.
    final NameValue
    Returns the LocalName or ScopedName to marshal.
    marshal(org.opengis.util.GenericName value)
    Replaces a generic name by its wrapper.
    final void
    Sets the value from the TypeName or MemberName.
    final void
    Sets the value for the LocalName or ScopedName.
    final org.opengis.util.GenericName
    Unwraps the generic name from the given element.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • name

      private org.opengis.util.GenericName name
      The 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

      public GO_GenericName marshal(org.opengis.util.GenericName value)
      Replaces a generic name by its wrapper. JAXB calls automatically this method at marshalling-time.
      Specified by:
      marshal in class XmlAdapter<GO_GenericName,org.opengis.util.GenericName>
      Parameters:
      value - the implementing class for this metadata value.
      Returns:
      an wrapper which contains the metadata value.
    • unmarshal

      public final org.opengis.util.GenericName unmarshal(GO_GenericName value)
      Unwraps the generic name from the given element. JAXB calls automatically this method at unmarshalling-time.
      Specified by:
      unmarshal in class XmlAdapter<GO_GenericName,org.opengis.util.GenericName>
      Parameters:
      value - the wrapper, or null if none.
      Returns:
      the implementing class.
    • getValue

      public final NameValue getValue()
      Returns the LocalName or ScopedName to marshal. Returns null if the name is a TypeName or a MemberName, in order to use getName() instead. Example:
      Returns:
      the code for the current name, or null if none.
    • getName

      public final DefaultLocalName getName()
      Returns the TypeName or MemberName to marshal. Returns null if the name is a LocalName or ScopedName, in order to use getValue() instead. Example:
      Returns:
      the current name, or null if none.
    • setValue

      public final void setValue(NameValue code) throws IllegalStateException
      Sets the value for the LocalName or ScopedName. This method is called at unmarshalling-time by JAXB.
      Parameters:
      code - the new name.
      Throws:
      IllegalStateException - if a name is already defined.
    • setName

      public final void setName(DefaultLocalName value) throws IllegalStateException
      Sets the value from the TypeName or MemberName. This method is called at unmarshalling-time by JAXB.
      Parameters:
      value - the new name.
      Throws:
      IllegalStateException - if a name is already defined.
    • ensureUndefined

      private void ensureUndefined() throws IllegalStateException
      Ensures that the name is not already defined.
      Throws:
      IllegalStateException - if a name is already defined.