Enum CodeType

java.lang.Object
java.lang.Enum<CodeType>
org.apache.sis.internal.storage.CodeType
All Implemented Interfaces:
Serializable, Comparable<CodeType>

public enum CodeType extends Enum<CodeType>
Heuristic rules for determining whether an authority code seems to be actually a file path, or a code defined in the URN namespace, or a simple code.
Since:
0.8
Version:
0.8
Author:
Martin Desruisseaux (IRD, Geomatys)
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The code is a filename like "/path/to/file" or "C:\path\to\file".
    The code is an URL in the "http://www.opengis.net" namespace.
    The code is not defined in the URN namespace but is nevertheless presumed to be an authority code.
    Cannot resolve whether the code is a local file like "myfile.wkt" or an identifier without authority like "4326".
    The code is a URL like "http:" or "file:", with the exception of HTTP in the "www.opengis.net" domain.
    The code is an authority code defined in the "urn:" namespace.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final boolean
    Whether the code may be understood by the CRS.forCode(String).
  • Method Summary

    Modifier and Type
    Method
    Description
    static CodeType
    guess(String codeOrPath)
    Infers the type for the given authority code.
    static CodeType
    Returns the enum constant of this type with the specified name.
    static CodeType[]
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • FILE

      public static final CodeType FILE
      The code is a filename like "/path/to/file" or "C:\path\to\file". Could also be a directory name.
    • URL

      public static final CodeType URL
      The code is a URL like "http:" or "file:", with the exception of HTTP in the "www.opengis.net" domain. The latter case is identified by HTTP_OGC instead of this enum.
    • URN

      public static final CodeType URN
      The code is an authority code defined in the "urn:" namespace.
    • HTTP_OGC

      public static final CodeType HTTP_OGC
      The code is an URL in the "http://www.opengis.net" namespace.
    • IDENTIFIER

      public static final CodeType IDENTIFIER
      The code is not defined in the URN namespace but is nevertheless presumed to be an authority code. Example: "EPSG:4326".
    • UNKNOWN

      public static final CodeType UNKNOWN
      Cannot resolve whether the code is a local file like "myfile.wkt" or an identifier without authority like "4326". Such code without cannot be decoded by CRS.forCode(String), but may be understood by a more specific authority factory.
  • Field Details

    • isCRS

      public final boolean isCRS
      Whether the code may be understood by the CRS.forCode(String). A value of true does not guaranteed the the code is valid. It only said that there is some chances that the code is valid.
  • Method Details

    • values

      public static CodeType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static CodeType valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • guess

      public static CodeType guess(String codeOrPath)
      Infers the type for the given authority code.
      Parameters:
      codeOrPath - the code or file path.
      Returns:
      whether the given argument seems to be a file path, URL, URN of authority code.