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 byteFactory needed isAuthorityFactory, the base interface of all factories.private StringThe authority of the factory, in upper case.(package private) static final byteFactory needed isCRSAuthorityFactory.(package private) static final byteFactory needed isCSAuthorityFactory.(package private) static final byteFactory needed isDatumAuthorityFactory.(package private) static final byteFactory needed is the Apache-SIS specificGeodeticAuthorityFactory.private static final LocaleThe locale to use for identifiers.(package private) static final byteFactory needed isCoordinateOperationAuthorityFactory.(package private) final byteprivate static final Class<? extends org.opengis.referencing.AuthorityFactory>[]The interfaces or abstract base classes for the above constants.private StringThe version part of a URI, ornullif none. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateAuthorityFactoryIdentifier(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 AuthorityFactoryIdentifierCreates a new identifier for a factory of the given type, authority and version.(package private) static AuthorityFactoryIdentifiercreate(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.booleanCompares the given object with this identifier.(package private) CharSequenceReturns the authority with the version, if any.inthashCode()Returns a hash code value for this object.(package private) booleanReturnstrueif this identifier is for a specific dataset version.(package private) AuthorityFactoryIdentifierintern()Ensures that the authority and version use sharedStringinstances.(package private) booleanReturnstrueif the given identifier is for the same authority than this identifier.private voidDo the logging of the warning prepared by the above methods.(package private) voidlogConflict(org.opengis.referencing.AuthorityFactory used) Logs a message reporting a conflict between the factory identified by thisAuthorityFactoryIdentifierand another factory, if this instance has not already logged a warning.(package private) voidLogs a warning about a factory not found for the requested version, in which caseAuthorityFactoryIdentifierfallback on a default version.(package private) AuthorityFactoryIdentifiernewType(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) AuthorityFactoryIdentifierunversioned(String newAuthority) Returns an identifier for a factory of the same type than this identifier, but a different authority and no version.(package private) AuthorityFactoryIdentifierversionOf(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, ornullif 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".
-
-
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, ornullfor creating an identifier without version.- Returns:
- an identifier for the version of the given authority, or
thisif 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 sharedStringinstances. This method is invoked only when we have determined that thisAuthorityFactoryIdentifierinstance 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
Returnstrueif 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()Returnstrueif 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 thisAuthorityFactoryIdentifierand 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 caseAuthorityFactoryIdentifierfallback 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.
-