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
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:PropertyTypeelement:gml:id,gco:uuidandxlink:href. Those attributes are not part of the ISO 19115 specification. Those authorities are declared in theIdentifierSpaceinterfaces. - 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
Citationsclass.
- Since:
- 0.3
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.internal.simple.CitationConstant
CitationConstant.Authority<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteOrdinal values for switch statements.static final byteOrdinal values for switch statements.static final byteOrdinal values for switch statements.static final byteOrdinal values for switch statements.(package private) final byteprivate static final longFor cross-version compatibility.static final byteOrdinal values for switch statements.static final byteOrdinal values for switch statements.Fields inherited from class org.apache.sis.internal.simple.CitationConstant
namespaceFields inherited from class org.apache.sis.internal.simple.SimpleCitation
title -
Constructor Summary
ConstructorsConstructorDescriptionNonMarshalledAuthority(String attribute, byte ordinal) Creates a new citation for the given XML attribute name. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 ofNonMarshalledAuthority.static <T extends org.opengis.metadata.Identifier>
TgetMarshallable(Collection<? extends T> identifiers) Returns the first marshallable identifier from the given collection.booleanReturnstrueif this authority is for ISBN or ISSN identifiers.protected ObjectInvoked at deserialization time in order to replace the deserialized instance by the appropriate instance defined in theIdentifierSpaceinterface.static <T extends org.opengis.metadata.Identifier>
Collection<T>setMarshallable(Collection<T> identifiers, T newValue) Sets the given identifier in the given collection.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 ofnewValues, together with unmarshallable values ofidentifiers.Methods inherited from class org.apache.sis.internal.simple.CitationConstant.Authority
getName, toStringMethods inherited from class org.apache.sis.internal.simple.CitationConstant
getAlternateTitles, getCitedResponsibleParties, getDates, getEdition, getEditionDate, getIdentifiers, getISBN, getISSN, getOtherCitationDetails, getPresentationForms, getSeries, getTitle, refreshMethods inherited from class org.apache.sis.internal.simple.SimpleCitation
equals, getCollectiveTitle, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.metadata.citation.Citation
getAlternateTitles, getCitedResponsibleParties, getCollectiveTitle, getDates, getEdition, getEditionDate, getIdentifiers, getISBN, getISSN, getOtherCitationDetails, getPresentationForms, getSeries, getTitle
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor cross-version compatibility.- See Also:
-
ID
public static final byte IDOrdinal values for switch statements. The constant defined here shall mirror the constants defined in theIdentifierSpaceinterface andDefaultCitationclass.- See Also:
-
UUID
public static final byte UUIDOrdinal values for switch statements. The constant defined here shall mirror the constants defined in theIdentifierSpaceinterface andDefaultCitationclass.- See Also:
-
HREF
public static final byte HREFOrdinal values for switch statements. The constant defined here shall mirror the constants defined in theIdentifierSpaceinterface andDefaultCitationclass.- See Also:
-
XLINK
public static final byte XLINKOrdinal values for switch statements. The constant defined here shall mirror the constants defined in theIdentifierSpaceinterface andDefaultCitationclass.- See Also:
-
ISSN
public static final byte ISSNOrdinal values for switch statements. The constant defined here shall mirror the constants defined in theIdentifierSpaceinterface andDefaultCitationclass.- See Also:
-
ISBN
public static final byte ISBNOrdinal values for switch statements. The constant defined here shall mirror the constants defined in theIdentifierSpaceinterface andDefaultCitationclass.- See Also:
-
ordinal
final transient byte ordinalOrdinal values for switch statements, as one of theID,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
Creates a new citation for the given XML attribute name.- Parameters:
attribute- the XML attribute name, to be returned byCitationConstant.Authority.getName().ordinal- ordinal value for switch statement, as one of theID,UUID, etc. constants.
-
-
Method Details
-
isBookOrSerialNumber
public boolean isBookOrSerialNumber()Returnstrueif 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, ornull.- Returns:
- the first identifier, or
nullif 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, ornull.- 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 ofNonMarshalledAuthority. This should exclude allIdentifierSpaceconstants.This method is used for implementation of
getIdentifiers()methods (plural form) in public metadata objects. Note that those methods overrideIdentifiedObject.getIdentifiers(), which is expected to return all identifiers in normal (non-marshalling) usage.- Parameters:
identifiers- the identifiers to filter, ornull.- Returns:
- the identifiers to marshal, or
nullif 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 ofnewValues, together with unmarshallable values ofidentifiers. 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, ornullif none.newValues- the identifiers to add, ornull.- Returns:
- the collection to set (may be
newValues. - See Also:
-
readResolve
Invoked at deserialization time in order to replace the deserialized instance by the appropriate instance defined in theIdentifierSpaceinterface.- Overrides:
readResolvein classCitationConstant- Returns:
- the instance to use, as an unique instance if possible.
- Throws:
ObjectStreamException- never thrown.
-