Class AbstractAuthorityFactory
- Object
-
- AbstractFactory
-
- ReferencingFactory
-
- AbstractAuthorityFactory
-
- All Implemented Interfaces:
AuthorityFactory
,Factory
,Factory
,RegistrableFactory
- Direct Known Subclasses:
AbstractAuthorityMediator
,AbstractCachedAuthorityFactory
,AuthorityFactoryAdapter
,BufferedAuthorityFactory
,CachedAuthorityDecorator
,CachedCRSAuthorityDecorator
,DirectAuthorityFactory
,ThreadedAuthorityFactory
public abstract class AbstractAuthorityFactory extends ReferencingFactory implements AuthorityFactory
Base class for authority factories. An authority is an organization that maintains definitions of authority codes. An authority code is a compact string defined by an authority to reference a particular spatial reference object. For example the European Petroleum Survey Group (EPSG) maintains a database of coordinate systems, and other spatial referencing objects, where each object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate system is"4326"
.This class defines a default implementation for most methods defined in the
DatumAuthorityFactory
,CSAuthorityFactory
andCRSAuthorityFactory
interfaces. However, those interfaces do not appear in theimplements
clause of this class declaration. This is up to subclasses to decide which interfaces they declare to implement.The default implementation for all
createFoo
methods ultimately invokescreateObject(java.lang.String)
, which may be the only method that a subclass need to override. However, other methods may be overridden as well for better performances.- Since:
- 2.1
- Author:
- Martin Desruisseaux (IRD)
-
-
Field Summary
-
Fields inherited from class ReferencingFactory
LOGGER
-
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractAuthorityFactory(int priority)
Constructs an instance using the specified priority level.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CartesianCS
createCartesianCS(String code)
Creates a cartesian coordinate system from a code.CompoundCRS
createCompoundCRS(String code)
Creates a 3D coordinate reference system from a code.CoordinateOperation
createCoordinateOperation(String code)
Creates an operation from a single operation code.CoordinateReferenceSystem
createCoordinateReferenceSystem(String code)
Returns an arbitrary coordinate reference system from a code.CoordinateSystem
createCoordinateSystem(String code)
Returns an arbitrary coordinate system from a code.CoordinateSystemAxis
createCoordinateSystemAxis(String code)
Returns a coordinate system axis from a code.CylindricalCS
createCylindricalCS(String code)
Creates a cylindrical coordinate system from a code.Datum
createDatum(String code)
Returns an arbitrary datum from a code.DerivedCRS
createDerivedCRS(String code)
Creates a derived coordinate reference system from a code.Ellipsoid
createEllipsoid(String code)
Returns an ellipsoid from a code.EllipsoidalCS
createEllipsoidalCS(String code)
Creates an ellipsoidal coordinate system from a code.EngineeringCRS
createEngineeringCRS(String code)
Creates a engineering coordinate reference system from a code.EngineeringDatum
createEngineeringDatum(String code)
Creates a engineering datum from a code.Extent
createExtent(String code)
Returns a extent (usually an area of validity) from a code.Set<CoordinateOperation>
createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS)
Creates an operation from coordinate reference system codes.GeocentricCRS
createGeocentricCRS(String code)
Returns a geocentric coordinate reference system from a code.GeodeticDatum
createGeodeticDatum(String code)
Returns a geodetic datum from a code.GeographicCRS
createGeographicCRS(String code)
Returns a geographic coordinate reference system from a code.ImageCRS
createImageCRS(String code)
Creates a image coordinate reference system from a code.ImageDatum
createImageDatum(String code)
Creates a image datum from a code.IdentifiedObject
createObject(String code)
Returns an arbitrary object from a code.OperationMethod
createOperationMethod(String code)
Creates an operation method from a code.ParameterDescriptor
createParameterDescriptor(String code)
Creates a parameter descriptor from a code.PolarCS
createPolarCS(String code)
Creates a polar coordinate system from a code.PrimeMeridian
createPrimeMeridian(String code)
Returns a prime meridian from a code.ProjectedCRS
createProjectedCRS(String code)
Returns a projected coordinate reference system from a code.SphericalCS
createSphericalCS(String code)
Creates a spherical coordinate system from a code.TemporalCRS
createTemporalCRS(String code)
Creates a temporal coordinate reference system from a code.TemporalDatum
createTemporalDatum(String code)
Creates a temporal datum from a code.TimeCS
createTimeCS(String code)
Creates a temporal coordinate system from a code.Unit<?>
createUnit(String code)
Returns an unit from a code.VerticalCRS
createVerticalCRS(String code)
Creates a vertical coordinate reference system from a code.VerticalCS
createVerticalCS(String code)
Creates a vertical coordinate system from a code.VerticalDatum
createVerticalDatum(String code)
Creates a vertical datum from a code.void
dispose()
Releases resources immediately instead of waiting for the garbage collector.abstract Citation
getAuthority()
Returns the organization or party responsible for definition and maintenance of the database.String
getBackingStoreDescription()
Returns a description of the underlying backing store, ornull
if unknown.IdentifiedObjectFinder
getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
Returns a finder which can be used for looking up unidentified objects.protected NoSuchAuthorityCodeException
noSuchAuthorityCode(Class type, String code)
Creates an exception for an unknow authority code.protected String
trimAuthority(String code)
Trims the authority scope, if present.-
Methods inherited from class ReferencingFactory
ensureNonNull, getVendor
-
Methods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
-
Methods inherited from interface AuthorityFactory
getAuthorityCodes, getDescriptionText
-
-
-
-
Constructor Detail
-
AbstractAuthorityFactory
protected AbstractAuthorityFactory(int priority)
Constructs an instance using the specified priority level.- Parameters:
priority
- The priority for this factory, as a number betweenMINIMUM_PRIORITY
andMAXIMUM_PRIORITY
inclusive.
-
-
Method Detail
-
getAuthority
public abstract Citation getAuthority()
Returns the organization or party responsible for definition and maintenance of the database.- Specified by:
getAuthority
in interfaceAuthorityFactory
- Returns:
- The organization reponsible for definition of the database.
-
getBackingStoreDescription
public String getBackingStoreDescription() throws FactoryException
Returns a description of the underlying backing store, ornull
if unknown. This is for example the database software used for storing the data. The default implementation returns alwaysnull
.- Returns:
- The description of the underlying backing store, or
null
. - Throws:
FactoryException
- if a failure occurs while fetching the engine description.
-
createObject
public IdentifiedObject createObject(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns an arbitrary object from a code. The returned object will typically be an instance ofDatum
,CoordinateSystem
,CoordinateReferenceSystem
orCoordinateOperation
. The default implementation always throw an exception. Subclasses should override this method if they are capable to automatically detect the object type from its code.- Specified by:
createObject
in interfaceAuthorityFactory
- Parameters:
code
- Value allocated by authority.- Returns:
- The object for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createCoordinateReferenceSystem(java.lang.String)
,createDatum(java.lang.String)
,createEllipsoid(java.lang.String)
,createUnit(java.lang.String)
-
createDatum
public Datum createDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns an arbitrary datum from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createGeodeticDatum(java.lang.String)
,createVerticalDatum(java.lang.String)
,createTemporalDatum(java.lang.String)
-
createEngineeringDatum
public EngineeringDatum createEngineeringDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a engineering datum from a code. The default implementation invokescreateDatum(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createEngineeringCRS(java.lang.String)
-
createImageDatum
public ImageDatum createImageDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a image datum from a code. The default implementation invokescreateDatum(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createImageCRS(java.lang.String)
-
createVerticalDatum
public VerticalDatum createVerticalDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a vertical datum from a code. The default implementation invokescreateDatum(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createVerticalCRS(java.lang.String)
-
createTemporalDatum
public TemporalDatum createTemporalDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a temporal datum from a code. The default implementation invokescreateDatum(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createTemporalCRS(java.lang.String)
-
createGeodeticDatum
public GeodeticDatum createGeodeticDatum(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a geodetic datum from a code. The default implementation invokescreateDatum(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createEllipsoid(java.lang.String)
,createPrimeMeridian(java.lang.String)
,createGeographicCRS(java.lang.String)
,createProjectedCRS(java.lang.String)
-
createEllipsoid
public Ellipsoid createEllipsoid(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns an ellipsoid from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The ellipsoid for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createGeodeticDatum(java.lang.String)
-
createPrimeMeridian
public PrimeMeridian createPrimeMeridian(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a prime meridian from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The prime meridian for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createGeodeticDatum(java.lang.String)
-
createExtent
public Extent createExtent(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a extent (usually an area of validity) from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The extent for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createCoordinateSystem
public CoordinateSystem createCoordinateSystem(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns an arbitrary coordinate system from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createCartesianCS
public CartesianCS createCartesianCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a cartesian coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createPolarCS
public PolarCS createPolarCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a polar coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createCylindricalCS
public CylindricalCS createCylindricalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a cylindrical coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createSphericalCS
public SphericalCS createSphericalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a spherical coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createEllipsoidalCS
public EllipsoidalCS createEllipsoidalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates an ellipsoidal coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createVerticalCS
public VerticalCS createVerticalCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a vertical coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createTimeCS
public TimeCS createTimeCS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a temporal coordinate system from a code. The default implementation invokescreateCoordinateSystem(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createCoordinateSystemAxis
public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a coordinate system axis from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The axis for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createUnit
public Unit<?> createUnit(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns an unit from a code. The default implementation invokescreateObject(code)
.- Parameters:
code
- Value allocated by authority.- Returns:
- The unit for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createCoordinateReferenceSystem
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns an arbitrary coordinate reference system from a code. If the coordinate reference system type is know at compile time, it is recommended to invoke the most precise method instead of this one (for examplecreateGeographicCRS(code)
instead ofcreateCoordinateReferenceSystem(code)
if the caller know he is asking for a geographic coordinate reference system).- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createGeographicCRS(java.lang.String)
,createProjectedCRS(java.lang.String)
,createVerticalCRS(java.lang.String)
,createTemporalCRS(java.lang.String)
,createCompoundCRS(java.lang.String)
-
createCompoundCRS
public CompoundCRS createCompoundCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a 3D coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createDerivedCRS
public DerivedCRS createDerivedCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a derived coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createEngineeringCRS
public EngineeringCRS createEngineeringCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a engineering coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createGeographicCRS
public GeographicCRS createGeographicCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a geographic coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createGeodeticDatum(java.lang.String)
-
createGeocentricCRS
public GeocentricCRS createGeocentricCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a geocentric coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed.- See Also:
createGeodeticDatum(java.lang.String)
-
createImageCRS
public ImageCRS createImageCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a image coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.
-
createProjectedCRS
public ProjectedCRS createProjectedCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Returns a projected coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createGeodeticDatum(java.lang.String)
-
createTemporalCRS
public TemporalCRS createTemporalCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a temporal coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createTemporalDatum(java.lang.String)
-
createVerticalCRS
public VerticalCRS createVerticalCRS(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a vertical coordinate reference system from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- See Also:
createVerticalDatum(java.lang.String)
-
createParameterDescriptor
public ParameterDescriptor createParameterDescriptor(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates a parameter descriptor from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- Since:
- 2.2
-
createOperationMethod
public OperationMethod createOperationMethod(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates an operation method from a code.- Parameters:
code
- Value allocated by authority.- Returns:
- The operation method for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- Since:
- 2.2
-
createCoordinateOperation
public CoordinateOperation createCoordinateOperation(String code) throws NoSuchAuthorityCodeException, FactoryException
Creates an operation from a single operation code.- Parameters:
code
- Value allocated by authority.- Returns:
- The operation for the given code.
- Throws:
NoSuchAuthorityCodeException
- if the specifiedcode
was not found.FactoryException
- if the object creation failed for some other reason.- Since:
- 2.2
-
createFromCoordinateReferenceSystemCodes
public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws NoSuchAuthorityCodeException, FactoryException
Creates an operation from coordinate reference system codes. The default implementation returns an {@linkplain Collections.emptySet() empty set}. We do not delegate to some kind of coordinate operation factory method because the usual contract for this method is to extract the information from an authority database like EPSG, not to compute operations on-the-fly.Rational: Coordinate operation factory backed by an authority will invoke this method. If this method invoked the coordinate operation factory in turn, the application could be trapped in infinite recursive calls.
- Parameters:
sourceCRS
- Coded value of source coordinate reference system.targetCRS
- Coded value of target coordinate reference system.- Returns:
- The operations from
sourceCRS
totargetCRS
. - Throws:
NoSuchAuthorityCodeException
- if a specified code was not found.FactoryException
- if the object creation failed for some other reason.- Since:
- 2.2
-
getIdentifiedObjectFinder
public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type) throws FactoryException
Returns a finder which can be used for looking up unidentified objects. The finder fetchs a fully identified object from an incomplete one, for example from an object without identifier or "AUTHORITY[...]
" element in Well Known Text terminology.- Parameters:
type
- The type of objects to look for. Should be a GeoAPI interface likeGeographicCRS.class
, but this method accepts also implementation class. If the type is unknown, useIdentifiedObject.class
. A more accurate type may help to speed up the search, since it reduces the amount of tables to scan in some implementations like the factories backed by EPSG database.- Returns:
- A finder to use for looking up unidentified objects.
- Throws:
FactoryException
- if the finder can not be created.- Since:
- 2.4
-
dispose
public void dispose() throws FactoryException
Releases resources immediately instead of waiting for the garbage collector. Once a factory has been disposed, furthercreate(...)
invocations may throw aFactoryException
. Disposing a previously-disposed factory, however, has no effect.- Throws:
FactoryException
- if an error occured while disposing the factory.
-
trimAuthority
protected String trimAuthority(String code)
Trims the authority scope, if present. For example if this factory is an EPSG authority factory and the specified code start with the "EPSG:" prefix, then the prefix is removed. Otherwise, the string is returned unchanged (except for leading and trailing spaces).- Parameters:
code
- The code to trim.- Returns:
- The code without the authority scope.
-
noSuchAuthorityCode
protected final NoSuchAuthorityCodeException noSuchAuthorityCode(Class type, String code)
Creates an exception for an unknow authority code. This convenience method is provided for implementation ofcreateXXX
methods.- Parameters:
type
- The GeoAPI interface that was to be created (e.g.CoordinateReferenceSystem.class
).code
- The unknow authority code.- Returns:
- An exception initialized with an error message built from the specified informations.
-
-