org.geotoolkit.xml
Interface IdentifiedObject


public interface IdentifiedObject

The interface for all Geotk objects having identifiers. Identifiers are String in a namespace identified by a Citation. The namespace can be some organization like EPSG for Coordinate Reference System objects, or a well-known acronym like ISBN for International Standard Book Number.

When an identified object is marshalled in a ISO 19139 compliant XML document, some identifiers are handled in a special way: they appear as gml:id, gco:uuid or xlink:href attributes of the XML element. Those identifiers can be specified using the IdentifierSpace enum values as below:

IdentifiedObject object = ...;
object.getIdentifierMap().put(IdentifierSpace.ID, "myID");


Relationship with GeoAPI
Identifiers exist also in some (not all) GeoAPI objects. Some GeoAPI objects (Instrument, Platform, Operation, Processing, etc.) have an explicit single identifier attribute, while other GeoAPI objects (Citation, Objective, referencing IdentifiedObject, etc.) allow an arbitrary number of identifiers. However GeoAPI does not define explicit methods for handling the id, uuid or href attributes, since they are specific to XML marshalling (they do not appear in OGC/ISO abstract specifications). This IdentifiedObject interface provides a way to handle those identifiers.

Note that GeoAPI defines a similar interface, also named IdentifiedObject. However that GeoAPI interface is not of general use, since it contains methods like toWKT() that are specific to referencing or geometric objects. In addition, the GeoAPI interface defines some attributes (name, alias, remarks) that are not needed for the purpose of handling XML id, uuid or href attributes.

Since:
3.18
Version:
3.19
Author:
Martin Desruisseaux (Geomatys)
See Also:
IdentifierSpace, MetadataEntity, ObjectLinker.newIdentifiedObject(Class, Identifier[])
Module:
utility/geotk-xml-base (download)    View source code for this class

Method Summary
 IdentifierMap getIdentifierMap()
          A map view of identifiers.
 Collection<? extends Identifier> getIdentifiers()
          Returns all identifiers associated to this object.
 XLink getXLink()
          Deprecated. Replaced by getIdentifierMap().getSpecialized(IdentifierSpace.XLINK).
 void setXLink(XLink link)
          Deprecated. Replaced by getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, link).
 

Method Detail

getIdentifiers

Collection<? extends Identifier> getIdentifiers()
Returns all identifiers associated to this object. Each identifier code shall be unique in the identifier authority name space. Examples of namespace are:

Note that XML ID attribute are actually unique only in the scope of the XML document being processed.

Returns:
All identifiers associated to this object, or an empty collection if none.
Since:
3.19
See Also:
DefaultCitation, DefaultObjective, AbstractIdentifiedObject

getIdentifierMap

IdentifierMap getIdentifierMap()
A map view of identifiers. Each map entry is associated to an element from the identifier collection in which the key is the identifier authority and the value is the identifier code.

There is usually a one-to-one relationship between the map entries and the identifier elements, but not always:

The map supports put operations if and only if this IdentifiedObject is modifiable.

Returns:
The identifiers as a map of (authority, code) entries, or an empty map if none.
Since:
3.19

getXLink

@Deprecated
XLink getXLink()
Deprecated. Replaced by getIdentifierMap().getSpecialized(IdentifierSpace.XLINK).

Returns the XML xlink attributes associated to this identified object, or null if none. The xlink attributes are often processed in a special way. See MetadataEntity for an example applicable to ISO 19139 document.

Returns:
XML xlink attributes, or null if none.

setXLink

@Deprecated
void setXLink(XLink link)
              throws UnsupportedOperationException
Deprecated. Replaced by getIdentifierMap().putSpecialized(IdentifierSpace.XLINK, link).

Sets the XML xlink attributes for this identified object. Callers should define one or many XLink attributes (href, role, arcrole, title, show and actuate) before to invoke this method.

Parameters:
link - XML xlink attributes, or null if none.
Throws:
UnsupportedOperationException - if this object is unmodifiable.


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.