Class NonMarshalledAuthority<T>

Type Parameters:
T - the type of object used as identifier values.
All Implemented Interfaces:
Serializable, IdentifierSpace<T>, org.opengis.metadata.citation.Citation

public final class NonMarshalledAuthority<T> extends CitationConstant.Authority<T>
The authority of identifiers that are not expected to be marshalled in a MD_Identifier XML element. Those identifiers are also excluded from the tree formatted by AbstractMetadata.asTreeTable().

There is two kinds of non-marshalled identifiers:

  • The XML attributes declared by ISO 19115-3 specification in the gco:PropertyType element: gml:id, gco:uuid and xlink:href. Those attributes are not part of the ISO 19115 specification. Those authorities are declared in the IdentifierSpace interfaces.
  • ISO 19115 attributes that we choose, for the SIS implementation, to merge with other identifiers: ISBN and ISSN codes. Those attributes are declared in the Citations class.
In the current SIS library, there is different places where identifiers are filtered on the basis of this class, as below:
Since:
0.3
Version:
1.0
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      For cross-version compatibility.
      See Also:
    • ID

      public static final byte ID
      Ordinal values for switch statements. The constant defined here shall mirror the constants defined in the IdentifierSpace interface and DefaultCitation class.
      See Also:
    • UUID

      public static final byte UUID
      Ordinal values for switch statements. The constant defined here shall mirror the constants defined in the IdentifierSpace interface and DefaultCitation class.
      See Also:
    • HREF

      public static final byte HREF
      Ordinal values for switch statements. The constant defined here shall mirror the constants defined in the IdentifierSpace interface and DefaultCitation class.
      See Also:
    • ISSN

      public static final byte ISSN
      Ordinal values for switch statements. The constant defined here shall mirror the constants defined in the IdentifierSpace interface and DefaultCitation class.
      See Also:
    • ISBN

      public static final byte ISBN
      Ordinal values for switch statements. The constant defined here shall mirror the constants defined in the IdentifierSpace interface and DefaultCitation class.
      See Also:
    • ordinal

      final transient byte ordinal
      Ordinal values for switch statements, as one of the ID, UUID, etc. constants.

      This value is not serialized because its value may not be consistent between different versions of the SIS library (the attribute name is more reliable). This instance should be replaced by one of the exiting constants at deserialization time anyway.

  • Constructor Details

    • NonMarshalledAuthority

      public NonMarshalledAuthority(String attribute, byte ordinal)
      Creates a new citation for the given XML attribute name.
      Parameters:
      attribute - the XML attribute name, to be returned by CitationConstant.Authority.getName().
      ordinal - ordinal value for switch statement, as one of the ID, UUID, etc. constants.
  • Method Details

    • isBookOrSerialNumber

      public boolean isBookOrSerialNumber()
      Returns true if this authority is for ISBN or ISSN identifiers.
      Returns:
      whether this authority is for ISBN or ISSN identifiers.
    • getMarshallable

      public static <T extends org.opengis.metadata.Identifier> T getMarshallable(Collection<? extends T> identifiers)
      Returns the first marshallable identifier from the given collection. This method omits "special" identifiers (ISO 19115-3 attributes, ISBN codes…), which are recognized by the implementation class of their authority.

      This method is used for implementation of getIdentifier() methods (singular form) in public metadata objects.

      Type Parameters:
      T - the type of object used as identifier values.
      Parameters:
      identifiers - the collection from which to get identifiers, or null.
      Returns:
      the first identifier, or null if none.
    • setMarshallable

      public static <T extends org.opengis.metadata.Identifier> Collection<T> setMarshallable(Collection<T> identifiers, T newValue)
      Sets the given identifier in the given collection. This method removes all identifiers that are not ISO 19115-3 identifiers before to adds the given one in the collection. This method is used when the given collection is expected to contains only one ISO 19115-1 identifier.

      This method is used for implementation of setIdentifier(Identifier) methods in public metadata objects.

      Type Parameters:
      T - the type of object used as identifier values.
      Parameters:
      identifiers - the collection in which to add the identifier.
      newValue - the identifier to add, or null.
      Returns:
      the given collection, or a new collection if the given collection was null.
      See Also:
    • filterOnMarshalling

      public static Collection<org.opengis.metadata.Identifier> filterOnMarshalling(Collection<org.opengis.metadata.Identifier> identifiers)
      If marshalling, filters the given collection of identifiers in order to omit any identifiers for which the authority is an instance of NonMarshalledAuthority. This should exclude all IdentifierSpace constants.

      This method is used for implementation of getIdentifiers() methods (plural form) in public metadata objects. Note that those methods override IdentifiedObject.getIdentifiers(), which is expected to return all identifiers in normal (non-marshalling) usage.

      Parameters:
      identifiers - the identifiers to filter, or null.
      Returns:
      the identifiers to marshal, or null if none.
    • setMarshallables

      public static Collection<? extends org.opengis.metadata.Identifier> setMarshallables(Collection<org.opengis.metadata.Identifier> identifiers, Collection<? extends org.opengis.metadata.Identifier> newValues)
      Returns a collection containing all marshallable values of newValues, together with unmarshallable values of identifiers. This method is invoked for preserving the identifiers that are conceptually stored in distinct fields (XML identifier, UUID, ISBN, ISSN) when setting the collection of all identifiers in a metadata object.

      This method is used for implementation of setIdentifiers(Collection) methods in public metadata objects.

      Parameters:
      identifiers - the metadata internal identifiers collection, or null if none.
      newValues - the identifiers to add, or null.
      Returns:
      the collection to set (may be newValues.
      See Also:
    • readResolve

      protected Object readResolve() throws ObjectStreamException
      Invoked at deserialization time in order to replace the deserialized instance by the appropriate instance defined in the IdentifierSpace interface.
      Overrides:
      readResolve in class CitationConstant
      Returns:
      the instance to use, as an unique instance if possible.
      Throws:
      ObjectStreamException - never thrown.