Class AuthorityFactoryIdentifier
java.lang.Object
org.apache.sis.referencing.factory.AuthorityFactoryIdentifier
Identification of an authority factory by its type, namespace and version.
- Since:
- 0.7
- Version:
- 0.7
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final byte
Factory needed isAuthorityFactory
, the base interface of all factories.private String
The authority of the factory, in upper case.(package private) static final byte
Factory needed isCRSAuthorityFactory
.(package private) static final byte
Factory needed isCSAuthorityFactory
.(package private) static final byte
Factory needed isDatumAuthorityFactory
.(package private) static final byte
Factory needed is the Apache-SIS specificGeodeticAuthorityFactory
.private static final Locale
The locale to use for identifiers.(package private) static final byte
Factory needed isCoordinateOperationAuthorityFactory
.(package private) final byte
private static final Class<? extends org.opengis.referencing.AuthorityFactory>[]
The interfaces or abstract base classes for the above constants.private String
The version part of a URI, ornull
if none. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AuthorityFactoryIdentifier
(byte type, String authority, String version) Creates a new identifier for a factory of the given type, authority and version. -
Method Summary
Modifier and TypeMethodDescription(package private) static AuthorityFactoryIdentifier
Creates a new identifier for a factory of the given type, authority and version.(package private) static AuthorityFactoryIdentifier
create
(Class<? extends org.opengis.referencing.AuthorityFactory> type, String authority, String version) Creates a new identifier for a factory of the given type, authority and version.boolean
Compares the given object with this identifier.(package private) CharSequence
Returns the authority with the version, if any.int
hashCode()
Returns a hash code value for this object.(package private) boolean
Returnstrue
if this identifier is for a specific dataset version.(package private) AuthorityFactoryIdentifier
intern()
Ensures that the authority and version use sharedString
instances.(package private) boolean
Returnstrue
if the given identifier is for the same authority than this identifier.private void
Do the logging of the warning prepared by the above methods.(package private) void
logConflict
(org.opengis.referencing.AuthorityFactory used) Logs a message reporting a conflict between the factory identified by thisAuthorityFactoryIdentifier
and another factory, if this instance has not already logged a warning.(package private) void
Logs a warning about a factory not found for the requested version, in which caseAuthorityFactoryIdentifier
fallback on a default version.(package private) AuthorityFactoryIdentifier
newType
(byte newType) Creates a new identifier for the same authority and version than this identifier, but a different factory.toString()
Returns a string representation of this identifier for debugging purpose.(package private) AuthorityFactoryIdentifier
unversioned
(String newAuthority) Returns an identifier for a factory of the same type than this identifier, but a different authority and no version.(package private) AuthorityFactoryIdentifier
versionOf
(org.opengis.metadata.citation.Citation factory) Creates a new identifier for the same type and authority than this identifier, but a different version extracted from the given authority.
-
Field Details
-
IDENTIFIER_LOCALE
The locale to use for identifiers. This is not necessarily the same locale than the one used for logging or error messages. -
CRS
static final byte CRSFactory needed isCRSAuthorityFactory
.- See Also:
-
CS
static final byte CSFactory needed isCSAuthorityFactory
.- See Also:
-
DATUM
static final byte DATUMFactory needed isDatumAuthorityFactory
.- See Also:
-
OPERATION
static final byte OPERATIONFactory needed isCoordinateOperationAuthorityFactory
.- See Also:
-
GEODETIC
static final byte GEODETICFactory needed is the Apache-SIS specificGeodeticAuthorityFactory
.- See Also:
-
ANY
static final byte ANYFactory needed isAuthorityFactory
, the base interface of all factories.- See Also:
-
TYPES
The interfaces or abstract base classes for the above constants. -
type
final byte type -
authority
The authority of the factory, in upper case. The upper case policy should be kept consistent withNameMeaning.AUTHORITIES
.Example: In the"urn:ogc:def:crs:EPSG:8.2:4326"
URN, this is"EPSG"
.- See Also:
-
version
The version part of a URI, ornull
if none. If the version contains alphabetic characters, they should be in lower case.Example: In the"urn:ogc:def:crs:EPSG:8.2:4326"
URN, this is"8.2"
.- See Also:
-
-
Constructor Details
-
AuthorityFactoryIdentifier
Creates a new identifier for a factory of the given type, authority and version. The given authority shall be already in upper cases and the version in lower cases (this is not verified by this constructor).
-
-
Method Details
-
create
static AuthorityFactoryIdentifier create(Class<? extends org.opengis.referencing.AuthorityFactory> type, String authority, String version) Creates a new identifier for a factory of the given type, authority and version. Only the version can be null. -
create
Creates a new identifier for a factory of the given type, authority and version. Only the version can be null. -
unversioned
Returns an identifier for a factory of the same type than this identifier, but a different authority and no version. -
versionOf
Creates a new identifier for the same type and authority than this identifier, but a different version extracted from the given authority.- Parameters:
factory
- the factory's authority, ornull
for creating an identifier without version.- Returns:
- an identifier for the version of the given authority, or
this
if the version is the same.
-
newType
Creates a new identifier for the same authority and version than this identifier, but a different factory. -
intern
AuthorityFactoryIdentifier intern()Ensures that the authority and version use sharedString
instances. This method is invoked only when we have determined that thisAuthorityFactoryIdentifier
instance will be used as a key in a hash map. -
hashCode
public int hashCode()Returns a hash code value for this object. -
equals
Compares the given object with this identifier. -
isSameAuthority
Returnstrue
if the given identifier is for the same authority than this identifier. -
getAuthorityAndVersion
CharSequence getAuthorityAndVersion()Returns the authority with the version, if any. -
hasVersion
boolean hasVersion()Returnstrue
if this identifier is for a specific dataset version. -
logConflict
void logConflict(org.opengis.referencing.AuthorityFactory used) Logs a message reporting a conflict between the factory identified by thisAuthorityFactoryIdentifier
and another factory, if this instance has not already logged a warning. This method assumes that it is invoked by theMultiAuthoritiesFactory.getAuthorityFactory(…)
method.- Parameters:
used
- the factory which will be used.
-
logFallback
void logFallback()Logs a warning about a factory not found for the requested version, in which caseAuthorityFactoryIdentifier
fallback on a default version. -
log
Do the logging of the warning prepared by the above methods. This method declaresMultiAuthoritiesFactory.getAuthorityFactory(…)
as the source of the log since it is the nearest public API. -
toString
Returns a string representation of this identifier for debugging purpose.
-