java.lang.Object
org.apache.sis.internal.jaxb.referencing.Code

public final class Code extends Object
The gml:CodeType, which is made of a code space and a code value.
Since:
0.4
Version:
0.7
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) String
    The identifier code.
    (package private) String
    The code space, which is often "EPSG" with the version in use.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Empty constructor for JAXB.
    Code(org.opengis.referencing.ReferenceIdentifier identifier)
    Creates a wrapper initialized to the values of the given identifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Code
    forIdentifiedObject(Class<?> type, Iterable<? extends org.opengis.referencing.ReferenceIdentifier> identifiers)
    Returns a <gml:identifier> for the given identified object, or null if none.
    org.opengis.referencing.ReferenceIdentifier
    Returns the identifier for this value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • code

      String code
      The 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 codeSpace
      The 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. The getIdentifier() 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 the codeSpace 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, or null 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, or null if none.
      Returns:
      the <gml:identifier> as a Code instance, or null if none.