@TitleProperty(name="code") 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"]]
<gml:identifier codeSpace="IOGP">urn:ogc:def:crs:EPSG::4326</gml:identifier>In Apache SIS, the GML
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:authority> <gmd:CI_Citation> <gmd:title> <gco:CharacterString>EPSG</gco:CharacterString> </gmd:title> </gmd:CI_Citation> </gmd:authority> <gmd:code> <gco:CharacterString>4326</gco:CharacterString> </gmd:code> </gmd:RS_Identifier>
DefaultIdentifier
,
IdentifiedObjects.toURN(Class, Identifier)
,
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()
The person or party responsible for maintenance of the namespace.
|
String |
getCode()
Alphanumeric value identifying an instance in the namespace.
|
String |
getCodeSpace()
Identifier or namespace in which the code is valid.
|
InternationalString |
getDescription()
Natural language description of the meaning of the code value.
|
String |
getVersion()
The version identifier for the namespace, as specified by the code authority.
|
int |
hashCode()
Returns a hash code value for this object.
|
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
- the person or party responsible for maintenance of the namespace, or null
if not available.codeSpace
- identifier or namespace in which the code is valid, or null
if not available.
This is often an abbreviation of the authority name.code
- alphanumeric value identifying an instance in the namespace. The code can not be null.public ImmutableIdentifier(Citation authority, String codeSpace, String code, String version, InternationalString description)
authority
- the person or party responsible for maintenance of the namespace, or null
if not available.codeSpace
- identifier or namespace in which the code is valid, or null
if not available.
This is often an abbreviation of the authority name.code
- alphanumeric value identifying an instance in the namespace. The code can not be null.version
- the version identifier for the namespace 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 Citation getAuthority()
getAuthority
in interface Identifier
null
if not available.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 String getVersion()
getVersion
in interface ReferenceIdentifier
null
if none.public InternationalString getDescription()
null
if none.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–2017 The Apache Software Foundation. All rights reserved.