Package org.apache.sis.metadata.iso
Class DefaultIdentifier
java.lang.Object
org.apache.sis.metadata.AbstractMetadata
org.apache.sis.metadata.ModifiableMetadata
org.apache.sis.metadata.iso.ISOMetadata
org.apache.sis.metadata.iso.DefaultIdentifier
- All Implemented Interfaces:
Serializable,Emptiable,LenientComparable,IdentifiedObject,org.opengis.metadata.Identifier
- Direct Known Subclasses:
RS_Identifier
@TitleProperty(name="code")
public class DefaultIdentifier
extends ISOMetadata
implements org.opengis.metadata.Identifier
Value uniquely identifying an object within a namespace.
The following property is mandatory in a well-formed metadata according ISO 19115:
One or more
MD_Identifier
└─code…………… Alphanumeric value identifying an instance in the namespace.Identifier instances can be associated to some metadata objects like
operation,
platform,
instrument,
event,
processing,
source,
image description,
geographic description
and more.
Referencing objects like
coordinate system axis,
geodetic datum,
geographic CRS and more
rather use the ImmutableIdentifier implementation,
which is a class unrelated to the usual org.apache.metadata hierarchy
because of the immutable nature of referencing objects.
Text, URN and XML representations
The XML representation ofDefaultIdentifier is as the following example:
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
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.sis.metadata.ModifiableMetadata
ModifiableMetadata.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.metadata.citation.CitationPerson or party responsible for maintenance of the namespace.private StringAlphanumeric value identifying an instance in the namespace.private StringIdentifier or namespace in which the code is valid.private org.opengis.util.InternationalStringNatural language description of the meaning of the code value.private static final longSerial number for inter-operability with different versions.private StringVersion identifier for the namespace, as specified by the code authority.Fields inherited from class org.apache.sis.metadata.iso.ISOMetadata
identifiersFields inherited from interface org.opengis.metadata.Identifier
AUTHORITY_KEY, CODE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionConstruct an initially empty identifier.DefaultIdentifier(String code) Creates an identifier initialized to the given code.DefaultIdentifier(String codeSpace, String code, String version) Creates a new identifier initialized to the given code, code space and version number.DefaultIdentifier(org.opengis.metadata.citation.Citation authority, String code) Creates an identifier initialized to the given authority and code.DefaultIdentifier(org.opengis.metadata.Identifier object) Constructs a new instance initialized with the values from the specified metadata object. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultIdentifiercastOrCopy(org.opengis.metadata.Identifier object) Returns a SIS metadata implementation with the values of the given arbitrary implementation.org.opengis.metadata.citation.CitationReturns the person or party responsible for maintenance of the namespace.getCode()Returns the alphanumeric value identifying an instance in the namespace.Returns the identifier or namespace in which the code is valid.org.opengis.util.InternationalStringReturns the natural language description of the meaning of the code value.Returns the version identifier for the namespace, as specified by the code authority.voidsetAuthority(org.opengis.metadata.citation.Citation newValue) Sets the person or party responsible for maintenance of the namespace.voidSets the alphanumeric value identifying an instance in the namespace.voidsetCodeSpace(String newValue) Sets the identifier or namespace in which the code is valid.voidsetDescription(org.opengis.util.InternationalString newValue) Sets the natural language description of the meaning of the code value.voidsetVersion(String newValue) Sets the version identifier for the namespace.Methods inherited from class org.apache.sis.metadata.iso.ISOMetadata
getIdentifier, getIdentifierMap, getIdentifiers, getStandard, setIdentifier, transitionToMethods inherited from class org.apache.sis.metadata.ModifiableMetadata
checkWritePermission, collectionType, copyCollection, copyList, copyMap, copySet, deepCopy, nonNullCollection, nonNullList, nonNullMap, nonNullSet, singleton, state, writeCollection, writeList, writeMap, writeSetMethods inherited from class org.apache.sis.metadata.AbstractMetadata
asMap, asTreeTable, equals, equals, getInterface, hashCode, isEmpty, prune, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
authority
private org.opengis.metadata.citation.Citation authorityPerson or party responsible for maintenance of the namespace.- See Also:
-
code
Alphanumeric value identifying an instance in the namespace.- See Also:
-
codeSpace
Identifier or namespace in which the code is valid.- See Also:
-
version
Version identifier for the namespace, as specified by the code authority. This version is included only when the code uses versions. When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.- See Also:
-
description
private org.opengis.util.InternationalString descriptionNatural language description of the meaning of the code value.- See Also:
-
-
Constructor Details
-
DefaultIdentifier
public DefaultIdentifier()Construct an initially empty identifier. -
DefaultIdentifier
Creates an identifier initialized to the given code.- Parameters:
code- the alphanumeric value identifying an instance in the namespace, ornullif none.
-
DefaultIdentifier
Creates a new identifier initialized to the given code, code space and version number.- Parameters:
codeSpace- identifier or namespace in which the code is valid, ornullif not available.code- alphanumeric value identifying an instance in the namespace, ornullif none.version- the version identifier for the namespace as specified by the code authority, ornullif none.- Since:
- 1.0
-
DefaultIdentifier
Creates an identifier initialized to the given authority and code. This constructor automatically initializes the code space to a value inferred from the givenauthority, if a suitable value can be found. This constructor proceeds by searching for the first suitable property in the following list:- The value of
IdentifierSpace.getName(). - A citation identifier which is a valid unicode identifier.
- Only if the citation has no identifier, a citation title or alternate title which is a valid unicode identifier.
- Parameters:
authority- the the person or party responsible for maintenance of the namespace, ornullif none.code- the alphanumeric value identifying an instance in the namespace, ornullif none.- See Also:
- The value of
-
DefaultIdentifier
public DefaultIdentifier(org.opengis.metadata.Identifier object) Constructs a new instance initialized with the values from the specified metadata object. This is a shallow copy constructor, because the other metadata contained in the given object are not recursively copied.- Parameters:
object- the metadata to copy values from, ornullif none.- See Also:
-
-
Method Details
-
castOrCopy
Returns a SIS metadata implementation with the values of the given arbitrary implementation. This method performs the first applicable action in the following choices:- If the given object is
null, then this method returnsnull. - Otherwise if the given object is already an instance of
DefaultIdentifier, then it is returned unchanged. - Otherwise a new
DefaultIdentifierinstance is created using the copy constructor and returned. Note that this is a shallow copy operation, because the other metadata contained in the given object are not recursively copied.
- Parameters:
object- the object to get as a SIS implementation, ornullif none.- Returns:
- a SIS implementation containing the values of the given object (may be the
given object itself), or
nullif the argument was null.
- If the given object is
-
getAuthority
public org.opengis.metadata.citation.Citation getAuthority()Returns the person or party responsible for maintenance of the namespace. The organization's abbreviation is often the same than this identifier code space, but not necessarily.- Specified by:
getAuthorityin interfaceorg.opengis.metadata.Identifier- Returns:
- person or party responsible for maintenance of the namespace, or
nullif not available.
-
setAuthority
public void setAuthority(org.opengis.metadata.citation.Citation newValue) Sets the person or party responsible for maintenance of the namespace.- Parameters:
newValue- the new authority.
-
getCode
Returns the alphanumeric value identifying an instance in the namespace. The code is optionally from a controlled list or pattern.Example:The code is mandatory according ISO specification, but this"4326".DefaultIdentifierimplementation does not enforce this restriction.- Specified by:
getCodein interfaceorg.opengis.metadata.Identifier- Returns:
- value identifying an instance in the namespace.
-
setCode
Sets the alphanumeric value identifying an instance in the namespace. Should avoid characters that are not legal in URLs.- Parameters:
newValue- the new code, ornull.
-
getCodeSpace
@UML(identifier="codeSpace", obligation=OPTIONAL, specification=ISO_19115) public String getCodeSpace()Returns the identifier or namespace in which the code is valid. This is often the authority's abbreviation, but not necessarily.Example:"EPSG".- Returns:
- the identifier or namespace in which the code is valid, or
nullif none. - Since:
- 0.5
-
setCodeSpace
Sets the identifier or namespace in which the code is valid.- Parameters:
newValue- the new code space, ornullif none.- Since:
- 0.5
-
getVersion
Returns the version identifier for the namespace, as specified by the code authority. This version is included only when the code uses versions. When appropriate, the edition is identified by the effective date, coded using ISO 8601 date format.Example: the version of the underlying EPSG database.- Returns:
- the version identifier for the namespace, or
nullif none.
-
setVersion
Sets the version identifier for the namespace.- Parameters:
newValue- the new version, ornullif none.
-
getDescription
@UML(identifier="description", obligation=OPTIONAL, specification=ISO_19115) public org.opengis.util.InternationalString getDescription()Returns the natural language description of the meaning of the code value.Example: "World Geodetic System 1984".- Returns:
- the natural language description, or
nullif none. - Since:
- 0.5
-
setDescription
public void setDescription(org.opengis.util.InternationalString newValue) Sets the natural language description of the meaning of the code value.- Parameters:
newValue- the new natural language description, ornullif none.- Since:
- 0.5
-