Package org.apache.sis.internal.storage
Enum CodeType
- All Implemented Interfaces:
Serializable
,Comparable<CodeType>
,java.lang.constant.Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe 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
FieldsModifier and TypeFieldDescriptionThe types for a list of known protocols.final boolean
Whether the code may be understood by theCRS.forCode(String)
. -
Constructor Summary
Constructors -
Method Summary
-
Enum Constant Details
-
FILE
The code is a filename like"/path/to/file"
or"C:\path\to\file"
. Could also be a directory name. -
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 byHTTP_OGC
instead of this enum. -
URN
The code is an authority code defined in the"urn:"
namespace. -
HTTP_OGC
The code is an URL in the"http://www.opengis.net"
namespace. -
IDENTIFIER
The code is not defined in the URN namespace but is nevertheless presumed to be an authority code. Example:"EPSG:4326"
. -
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 byCRS.forCode(String)
, but may be understood by a more specific authority factory.
-
-
Field Details
-
isCRS
public final boolean isCRSWhether the code may be understood by theCRS.forCode(String)
. A value oftrue
does not guaranteed the the code is valid. It only said that there is some chances that the code is valid. -
FOR_PROTOCOL
The types for a list of known protocols. Protocol must be lower-cases.This map is used for resolving ambiguity between "PROTOCOL:FILE" and "AUTHORITY:CODE". If the given path begins with a file separator like "PROTOCOL:/PATH/FILE", then the path is presumed to be a URL even if the protocol is not in this map.
-
-
Constructor Details
-
CodeType
private CodeType(boolean isCRS) Creates a new enum value.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
guess
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.
-