Class ISOMetadata

All Implemented Interfaces:
Serializable, Emptiable, Lenient­Comparable, Identified­Object
Direct Known Subclasses:
Abstract­Content­Information, Abstract­Element, Abstract­Geographic­Extent, Abstract­Geolocation­Information, Abstract­Identification, Abstract­Party, Abstract­Result, Abstract­Spatial­Representation, Default­Acquisition­Information, Default­Address, Default­Algorithm, Default­Application­Schema­Information, Default­Associated­Resource, Default­Attribute­Group, Default­Browse­Graphic, Default­Citation, Default­Citation­Date, Default­Constraints, Default­Contact, Default­Coupled­Resource, Default­Data­File, Default­Data­Quality, Default­Digital­Transfer­Options, Default­Dimension, Default­Distribution, Default­Distributor, Default­Environmental­Record, Default­Event, Default­Extended­Element­Information, Default­Extent, Default­Feature­Type­Info, Default­Format, Default­GCP, Default­Geometric­Objects, Default­Identifier, Default­Instrument, Default­Keyword­Class, Default­Keywords, Default­Lineage, Default­Maintenance­Information, Default­Medium, Default­Metadata, Default­Metadata­Extension­Information, Default­Metadata­Scope, Default­Nominal­Resolution, Default­Objective, Default­Online­Resource, Default­Operation, Default­Operation­Chain­Metadata, Default­Operation­Metadata, Default­Plan, Default­Platform, Default­Platform­Pass, Default­Portrayal­Catalogue­Reference, Default­Processing, Default­Process­Step, Default­Process­Step­Report, Default­Range­Dimension, Default­Range­Element­Description, Default­Releasability, Default­Requested­Date, Default­Requirement, Default­Resolution, Default­Responsibility, Default­Scope, Default­Scope­Description, Default­Series, Default­Source, Default­Standard­Order­Process, Default­Telephone, Default­Temporal­Extent, Default­Usage, Default­Vertical­Extent

public class ISOMetadata extends ModifiableMetadata implements IdentifiedObject, Serializable
The base class of ISO 19115 implementation classes. Each sub-classes implements one of the ISO Metadata interface provided by GeoAPI.

Limitations

  • Instances of this class are not synchronized for multi-threading. Synchronization, if needed, is caller's responsibility.
  • Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases. Serialization support is appropriate for short term storage or RMI between applications running the same version of Apache SIS. For long term storage, use XML instead.
Since:
0.3
See Also:

Defined in the sis-metadata module

  • Field Details

    • identifiers

      protected Collection<Identifier> identifiers
      All identifiers associated with this metadata, or null if none. This field is initialized to a non-null value when first needed.
  • Constructor Details

    • ISOMetadata

      protected ISOMetadata()
      Constructs an initially empty metadata.
    • ISOMetadata

      protected ISOMetadata(Object object)
      Constructs a new metadata initialized with the values from the specified object. If the given object is an instance of Identified­Object, then this constructor copies the collection of identifiers.
      Parameters:
      object - the metadata to copy values from, or null if none.
  • Method Details

    • getStandard

      public MetadataStandard getStandard()
      Returns the metadata standard implemented by subclasses, which is ISO 19115.

      Note for implementers

      Subclasses shall not override this method in a way that depends on the object state, since this method may be indirectly invoked by copy constructors (i.e. is may be invoked before this metadata object is fully constructed).
      Specified by:
      get­Standard in class Abstract­Metadata
      Returns:
      the metadata standard, which is ISO 19115 by default.
    • getIdentifiers

      public Collection<Identifier> getIdentifiers()
      Returns all identifiers associated to this object (from conceptual model and from XML document). This collection may contain identifiers from different sources:
      • Identifiers specified in the ISO 19115-1 or 19115-2 abstract models, typically (but not necessarily) as an identifier property (may also be metadata­Identifier, ISBN or ISSN properties).
      • Identifiers specified in the ISO 19115-3 or 19115-4 XML schemas. Those identifiers are typically stored as a result of unmarshalling an XML document. Those identifiers can be recognized by an authority sets as one of the Identifier­Space constants.
      Specified by:
      get­Identifiers in interface Identified­Object
      Returns:
      all identifiers associated to this object, or an empty collection if none.
      See Also:
    • getIdentifierMap

      public IdentifierMap getIdentifierMap()
      A map view of the identifiers collection as (authority, code) entries. Each map entry is associated to an element from the above 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 view may contain less entries, because the map interface allows only one entry per authority. If the identifier collection contains many identifiers for the same authority, then only the first occurrence is visible through this Map view.
      • The map view may also contain more entries than the identifier collection. For example the Citation interface defines separated attributes for ISBN, ISSN and other identifiers. This map view may choose to unify all those attributes in a single view.
      The map supports put operations if and only if this Identified­Object is modifiable.

      The default implementation returns a wrapper around the identifiers list. That map is live: changes in the identifiers list will be reflected in the map, and conversely.

      Specified by:
      get­Identifier­Map in interface Identified­Object
      Returns:
      the identifiers as a map of (authority, code) entries, or an empty map if none.
    • getIdentifier

      protected Identifier getIdentifier()
      Returns the first identifier which is presumed to be defined by ISO 19115 conceptual model. This method checks the authority for filtering ignorable identifiers like ISBN/ISSN codes and XML attributes. This convenience method is provided for implementation of public get­Identifier(Identifier) methods in subclasses having an identifier property with [0 … 1] multiplicity.
      Returns:
      an identifier from ISO 19115-3 conceptual model (excluding XML identifiers), or null if none.
      Since:
      1.0
    • setIdentifier

      protected void setIdentifier(Identifier newValue)
      Sets the identifier for metadata objects that are expected to contain at most one ISO 19115 identifier. This convenience method is provided for implementation of public set­Identifier(Identifier) methods in subclasses having an identifier property with [0 … 1] multiplicity. The default implementation removes all identifiers that would be returned by get­Identifier() before to add the given one in the identifiers collection.
      Parameters:
      new­Value - the new identifier value, or null for removing the identifier.
      Since:
      1.0
    • transitionTo

      public boolean transitionTo(ModifiableMetadata.State target)
      Requests this metadata instance and (potentially) all its children to transition to a new state. The action performed by this method depends on the source state and the given target state, as listed in the following table:
      State transitions
      Current state Target state Action
      Any Same Does nothing and returns false.
      ModifiableMetadata.State.EDITABLE ModifiableMetadata.State.COMPLETABLE Marks this metadata and all children as completable.
      Any ModifiableMetadata.State.FINAL Marks this metadata and all children as unmodifiable.
      ModifiableMetadata.State.FINAL Any other Throws Unmodifiable­Metadata­Exception.
      The effect of invoking this method may be recursive. For example transitioning to Modifiable­Metadata​.State​.FINAL implies transitioning all children Modifiable­Metadata instances to the final state too.
      Overrides:
      transition­To in class Modifiable­Metadata
      Parameters:
      target - the desired new state (editable, completable or final).
      Returns:
      true if the state of this Modifiable­Metadata changed as a result of this method call.