public class ImmutableIdentifier extends FormattableObject implements ReferenceIdentifier, Serializable
CoordinateReferenceSystem
objects.
Citation
and InternationalString
arguments given to the constructor are also immutable. It is caller's responsibility to ensure that those
conditions hold, for example by invoking DefaultCitation.freeze()
before passing the arguments to the constructor.
Subclasses shall make sure that any overridden methods remain safe to call from multiple threads and do not change
any public ImmutableIdentifier
state.
AUTHORITY["EPSG", "4326"]
URI
element, which expresses the same information in a different way
(the URN syntax is described in the next item below).
Example:
ID["EPSG", 4326, URI["urn:ogc:def:crs:EPSG::4326"]]
In Apache SIS, the GML<gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>
codeSpace
attribute - despite its name - is mapped to the identifier
authority. The components of the URN value are mapped as below:
urn:ogc:def:<type>:<codespace>:<version>:<code>
ImmutableIdentifier
in a metadata is similar to the DefaultIdentifier
one except for the "RS_"
prefix:
<gmd:RS_Identifier> <gmd:code> <gco:CharacterString>4326</gco:CharacterString> </gmd:code> <gmd:authority> <gmd:CI_Citation> <gmd:title> <gco:CharacterString>EPSG</gco:CharacterString> </gmd:title> </gmd:CI_Citation> </gmd:authority> </gmd:RS_Identifier>
DefaultIdentifier
,
Serialized FormDefined in the sis-metadata
module
Modifier and Type | Field and Description |
---|---|
static String |
DESCRIPTION_KEY
Key for the "description" property in the map to be given to the constructor.
|
CODESPACE_KEY, VERSION_KEY
AUTHORITY_KEY, CODE_KEY
Constructor and Description |
---|
ImmutableIdentifier(Citation authority,
String codeSpace,
String code)
Creates a new identifier from the specified code and authority.
|
ImmutableIdentifier(Citation authority,
String codeSpace,
String code,
String version,
InternationalString description)
Creates a new identifier from the specified code and authority,
with an optional version number and description.
|
ImmutableIdentifier(Map<String,?> properties)
Constructs an identifier from the given properties.
|
ImmutableIdentifier(ReferenceIdentifier identifier)
Creates a new identifier from the specified one.
|
Modifier and Type | Method and Description |
---|---|
static ImmutableIdentifier |
castOrCopy(ReferenceIdentifier object)
Returns a SIS identifier implementation with the values of the given arbitrary implementation.
|
boolean |
equals(Object object)
Compares this object with the given one for equality.
|
protected String |
formatTo(Formatter formatter)
Formats this identifier as a Well Known Text
Id[…] element. |
Citation |
getAuthority()
Organization or party responsible for definition and maintenance of the code.
|
String |
getCode()
Identifier code or name, optionally from a controlled list or pattern.
|
String |
getCodeSpace()
Name or identifier of the person or organization responsible for namespace.
|
InternationalString |
getDescription()
Natural language description of the meaning of the code value.
|
InternationalString |
getRemarks()
Deprecated.
Replaced by
getDescription() for non-deprecated identifiers, or by
Deprecable.getRemarks() for identifiers that may be deprecated. |
String |
getVersion()
Identifier of the version of the associated code space or code, as specified by the code authority.
|
int |
hashCode()
Returns a hash code value for this object.
|
boolean |
isDeprecated()
Deprecated.
Moved to
Deprecable.isDeprecated() if this
ImmutableIdentifier instance implements Deprecable . |
print, toString, toString, toWKT
public static final String DESCRIPTION_KEY
getDescription()
.public ImmutableIdentifier(ReferenceIdentifier identifier)
identifier
- The identifier to copy.public ImmutableIdentifier(Citation authority, String codeSpace, String code)
authority
- Organization or party responsible for definition and maintenance of the code
space or code, or null
if not available.codeSpace
- Name or identifier of the person or organization responsible for namespace, or
null
if not available. This is often an abbreviation of the authority name.code
- Identifier code or name, optionally from a controlled list or pattern defined by
a code space. The code can not be null.public ImmutableIdentifier(Citation authority, String codeSpace, String code, String version, InternationalString description)
authority
- Organization or party responsible for definition and maintenance of the code
space or code, or null
if not available.codeSpace
- Name or identifier of the person or organization responsible for namespace, or
null
if not available. This is often an abbreviation of the authority name.code
- Identifier code or name, optionally from a controlled list or pattern defined by
a code space. The code can not be null.version
- The version of the associated code space or code as specified by the code authority,
or null
if none.description
- Natural language description of the meaning of the code value, or null
if none.public ImmutableIdentifier(Map<String,?> properties) throws IllegalArgumentException
Property name | Value type | Returned by |
---|---|---|
"code" | String |
getCode() |
"codespace" | String |
getCodeSpace() |
"authority" | String or Citation |
getAuthority() |
"version" | String |
getVersion() |
"description" | String or InternationalString |
getDescription() |
"locale" | Locale |
(none) |
"description"
is a localizable attributes which may have a language and country
code suffix. For example the "description_fr"
property stands for description in
French and the "description_fr_CA"
property stands
for description in French Canadian.
The "locale"
property applies only to exception messages, if any.
After successful construction, ImmutableIdentifier
instances do not keep the locale
since localizations are deferred to the InternationalString.toString(Locale)
method.
properties
- The properties to be given to this identifier.IllegalArgumentException
- if a property has an illegal value.public static ImmutableIdentifier castOrCopy(ReferenceIdentifier object)
null
, then this method returns null
.ImmutableIdentifier
, then it is returned unchanged.ImmutableIdentifier
instance is created using the
copy constructor and returned.
Note that this is a shallow copy operation, since the other
metadata contained in the given object are not recursively copied.object
- The object to get as a SIS implementation, or null
if none.null
if the argument was null.public String getCode()
"4326"
.getCode
in interface Identifier
null
.NamedIdentifier.tip()
public String getCodeSpace()
"EPSG"
.getCodeSpace
in interface ReferenceIdentifier
null
if not available.NamedIdentifier.head()
,
NamedIdentifier.scope()
public Citation getAuthority()
getAuthority
in interface Identifier
null
if not available.public String getVersion()
getVersion
in interface ReferenceIdentifier
null
if not available.public InternationalString getDescription()
null
if none.@Deprecated public InternationalString getRemarks()
getDescription()
for non-deprecated identifiers, or by
Deprecable.getRemarks()
for identifiers that may be deprecated.null
if none.
null
if none.@Deprecated public boolean isDeprecated()
Deprecable.isDeprecated()
if this
ImmutableIdentifier
instance implements Deprecable
.true
if the object represented by this identifier is deprecated. In such
case, the remarks may contains the new identifier to use.
The default implementation returns false
in all cases.
true
if this code is deprecated.AbstractIdentifiedObject.isDeprecated()
public int hashCode()
public boolean equals(Object object)
protected String formatTo(Formatter formatter)
Id[…]
element.
See class javadoc for more information on the WKT format.formatTo
in class FormattableObject
formatter
- The formatter where to format the inner content of this WKT element."Id"
(WKT 2) or "Authority"
(WKT 1).Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.