Class Code
java.lang.Object
org.apache.sis.internal.jaxb.referencing.Code
The
gml:CodeType
, which is made of a code space and a code value.- Since:
- 0.4
- Version:
- 0.7
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Code
forIdentifiedObject
(Class<?> type, Iterable<? extends org.opengis.referencing.ReferenceIdentifier> identifiers) Returns a<gml:identifier>
for the given identified object, ornull
if none.org.opengis.referencing.ReferenceIdentifier
Returns the identifier for this value.
-
Field Details
-
code
String codeThe identifier code.Note: GML (the target of this class) represents that code as an XML value, while
DefaultIdentifier
represents it as an XML element. -
codeSpace
String codeSpaceThe code space, which is often"EPSG"
with the version in use.Note: GML (the target of this class) represents that code as an XML attribute, while
DefaultIdentifier
represents it as an XML element.
-
-
Constructor Details
-
Code
Code()Empty constructor for JAXB. -
Code
Code(org.opengis.referencing.ReferenceIdentifier identifier) Creates a wrapper initialized to the values of the given identifier. Version number, if presents, will be appended after the codespace with a semicolon separator. ThegetIdentifier()
method shall be able to perform the opposite operation (split the above in separated codespace and version attributes).- Parameters:
identifier
- the identifier from which to get the values.
-
-
Method Details
-
getIdentifier
public org.opengis.referencing.ReferenceIdentifier getIdentifier()Returns the identifier for this value. This method is the converse of the constructor. If thecodeSpace
contains a semicolon, then the part after the last semicolon will be taken as the authority version number. This is for consistency with what the constructor does.- Returns:
- the identifier, or
null
if none.
-
forIdentifiedObject
public static Code forIdentifiedObject(Class<?> type, Iterable<? extends org.opengis.referencing.ReferenceIdentifier> identifiers) Returns a<gml:identifier>
for the given identified object, ornull
if none. This method searches for the following identifiers, in preference order:- The first identifier having a code that begin with
"urn:"
. - The first identifier having a code that begin with
"http:"
. - The first identifier in the
"EPSG"
codespace, converted to the"urn:
syntax. - The first identifier in other codespace, converted to the
"urn:
syntax if possible.
- Parameters:
type
- the type of the identified object.identifiers
- the object identifiers, ornull
if none.- Returns:
- the
<gml:identifier>
as aCode
instance, ornull
if none.
- The first identifier having a code that begin with
-