Package org.apache.sis.metadata.iso
Class ISOMetadata
- Object
-
- AbstractMetadata
-
- ModifiableMetadata
-
- ISOMetadata
-
- All Implemented Interfaces:
Serializable,Emptiable,LenientComparable,IdentifiedObject
- Direct Known Subclasses:
AbstractContentInformation,AbstractElement,AbstractGeographicExtent,AbstractGeolocationInformation,AbstractIdentification,AbstractParty,AbstractResult,AbstractSpatialRepresentation,DefaultAcquisitionInformation,DefaultAddress,DefaultAlgorithm,DefaultApplicationSchemaInformation,DefaultAssociatedResource,DefaultAttributeGroup,DefaultBrowseGraphic,DefaultCitation,DefaultCitationDate,DefaultConstraints,DefaultContact,DefaultCoupledResource,DefaultDataFile,DefaultDataQuality,DefaultDigitalTransferOptions,DefaultDimension,DefaultDistribution,DefaultDistributor,DefaultEnvironmentalRecord,DefaultEvent,DefaultExtendedElementInformation,DefaultExtent,DefaultFeatureTypeInfo,DefaultFormat,DefaultGCP,DefaultGeometricObjects,DefaultIdentifier,DefaultInstrument,DefaultKeywordClass,DefaultKeywords,DefaultLineage,DefaultMaintenanceInformation,DefaultMedium,DefaultMetadata,DefaultMetadataExtensionInformation,DefaultMetadataScope,DefaultNominalResolution,DefaultObjective,DefaultOnlineResource,DefaultOperation,DefaultOperationChainMetadata,DefaultOperationMetadata,DefaultPlan,DefaultPlatform,DefaultPlatformPass,DefaultPortrayalCatalogueReference,DefaultProcessing,DefaultProcessStep,DefaultProcessStepReport,DefaultRangeDimension,DefaultRangeElementDescription,DefaultReleasability,DefaultRequestedDate,DefaultRequirement,DefaultResolution,DefaultResponsibility,DefaultScope,DefaultScopeDescription,DefaultSeries,DefaultSource,DefaultStandardOrderProcess,DefaultTelephone,DefaultTemporalExtent,DefaultUsage,DefaultVerticalExtent
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
XMLinstead.
- Since:
- 0.3
- See Also:
- Serialized Form
Defined in the
sis-metadatamodule
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ModifiableMetadata
ModifiableMetadata.State
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<Identifier>identifiersAll identifiers associated with this metadata, ornullif none.
-
Constructor Summary
Constructors Modifier Constructor Description protectedISOMetadata()Constructs an initially empty metadata.protectedISOMetadata(Object object)Constructs a new metadata initialized with the values from the specified object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IdentifiergetIdentifier()Returns the first identifier which is presumed to be defined by ISO 19115 conceptual model.IdentifierMapgetIdentifierMap()A map view of the identifiers collection as (authority, code) entries.Collection<Identifier>getIdentifiers()Returns all identifiers associated to this object (from conceptual model and from XML document).MetadataStandardgetStandard()Returns the metadata standard implemented by subclasses, which is ISO 19115.protected voidsetIdentifier(Identifier newValue)Sets the identifier for metadata objects that are expected to contain at most one ISO 19115 identifier.booleantransitionTo(ModifiableMetadata.State target)Requests this metadata instance and (potentially) all its children to transition to a new state.-
Methods inherited from class ModifiableMetadata
checkWritePermission, checkWritePermission, collectionType, copyCollection, copyList, copyMap, copySet, freeze, isModifiable, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, unmodifiable, writeCollection, writeList, writeMap, writeSet
-
Methods inherited from class AbstractMetadata
asMap, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, prune, toString
-
-
-
-
Field Detail
-
identifiers
protected Collection<Identifier> identifiers
All identifiers associated with this metadata, ornullif none. This field is initialized to a non-null value when first needed.
-
-
Constructor Detail
-
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 ofIdentifiedObject, then this constructor copies the collection of identifiers.- Parameters:
object- the metadata to copy values from, ornullif none.
-
-
Method Detail
-
getStandard
public MetadataStandard getStandard()
Returns the metadata standard implemented by subclasses, which is ISO 19115.Note for implementersSubclasses 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:
getStandardin classAbstractMetadata- 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
identifierproperty (may also bemetadataIdentifier,ISBNorISSNproperties). - 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
IdentifierSpaceconstants.
- Specified by:
getIdentifiersin interfaceIdentifiedObject- Returns:
- all identifiers associated to this object, or an empty collection if none.
- See Also:
DefaultCitation.getIdentifiers(),DefaultObjective.getIdentifiers(),AbstractIdentifiedObject.getIdentifiers()
- Identifiers specified in the ISO 19115-1 or 19115-2 abstract models,
typically (but not necessarily) as an
-
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
Mapview. - The map view may also contain more entries than the identifier collection. For example the
Citationinterface defines separated attributes for ISBN, ISSN and other identifiers. This map view may choose to unify all those attributes in a single view.
putoperations if and only if thisIdentifiedObjectis modifiable.The default implementation returns a wrapper around the
identifierslist. That map is live: changes in the identifiers list will be reflected in the map, and conversely.- Specified by:
getIdentifierMapin interfaceIdentifiedObject- Returns:
- the identifiers as a map of (authority, code) entries, or an empty map if none.
- 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
-
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 publicgetIdentifier(Identifier)methods in subclasses having anidentifierproperty with [0 … 1] multiplicity.- Returns:
- an identifier from ISO 19115-3 conceptual model (excluding XML identifiers),
or
nullif 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 publicsetIdentifier(Identifier)methods in subclasses having anidentifierproperty with [0 … 1] multiplicity. The default implementation removes all identifiers that would be returned bygetIdentifier()before to add the given one in theidentifierscollection.- Parameters:
newValue- the new identifier value, ornullfor 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:
The effect of invoking this method may be recursive. For example transitioning toState transitions Current state Target state Action Any Same Does nothing and returns false.ModifiableMetadata.State.EDITABLEModifiableMetadata.State.COMPLETABLEMarks this metadata and all children as completable. Any ModifiableMetadata.State.FINALMarks this metadata and all children as unmodifiable. ModifiableMetadata.State.FINALAny other Throws UnmodifiableMetadataException.ModifiableMetadata.State.FINALimplies transitioning all childrenModifiableMetadatainstances to the final state too.- Overrides:
transitionToin classModifiableMetadata- Parameters:
target- the desired new state.- Returns:
trueif the state of thisModifiableMetadatachanged as a result of this method call.
-
-