An authority factory which delegates
,
or
objects creation to
some other factory implementations.
All constructors are protected because this class must be subclassed in order to determine
which of the
DatumAuthorityFactory ,
CSAuthorityFactory and
CRSAuthorityFactory interfaces to implement.
since: 2.2 version: $Id: AuthorityFactoryAdapter.java 26212 2007-07-12 02:34:18Z jgarnett $ author: Martin Desruisseaux
AuthorityFactoryAdapter(CRSAuthorityFactory crsFactory, CSAuthorityFactory csFactory, DatumAuthorityFactory datumFactory, CoordinateOperationAuthorityFactory opFactory) Creates a wrapper around the specified factories.
protected
AuthorityFactoryAdapter(String authority, Hints userHints) Creates a wrappers around the default factories for the specified authority.
The factories are fetched using
ReferencingFactoryFinder .
Parameters: authority - The authority to wraps (example: "EPSG" ).
Creates a wrapper around no factory. This constructor should never be used except by
subclasses overriding the getFooAuthorityFactory
methods.
Parameters: priority - The priority for this factory, as a number betweenAuthorityFactoryAdapter.MINIMUM_PRIORITY MINIMUM_PRIORITY andAuthorityFactoryAdapter.MAXIMUM_PRIORITY MAXIMUM_PRIORITY inclusive.
Creates a wrapper around the specified factory. The
AuthorityFactoryAdapter.priority priority field
will be set to the same value than the specified factory. Subclasses should override
the
AuthorityFactoryAdapter.getPriority() getPriority() method if they want to set a higher or lower
priority for this instance.
Parameters: factory - The factory to wrap.
Creates a wrapper around the specified factories. The
AuthorityFactoryAdapter.priority priority field will
be set to the highest priority found in the specified factories. Subclasses should override
the
AuthorityFactoryAdapter.getPriority() getPriority() method if they want to set a higher or lower
priority for this instance.
Parameters: crsFactory - The authority factory, or null . Parameters: csFactory - The authority factory,or null . Parameters: datumFactory - The authority factory, or null . Parameters: opFactory - The authorityfactory, or null .
Creates a wrappers around the default factories for the specified authority.
The factories are fetched using
ReferencingFactoryFinder .
Parameters: authority - The authority to wraps (example: "EPSG" ). If null ,then all authority factories must be explicitly specified in theset of hints. Parameters: userHints - An optional set of hints, or null if none. throws: FactoryRegistryException - if at least one factory can not be obtained. since: 2.4
Method Detail
createCartesianCS
public CartesianCS createCartesianCS(String code) throws FactoryException(Code)
Creates a cartesian coordinate system from a code.
createCompoundCRS
public CompoundCRS createCompoundCRS(String code) throws FactoryException(Code)
Creates a 3D coordinate reference system from a code.
createCoordinateOperation
public CoordinateOperation createCoordinateOperation(String code) throws FactoryException(Code)
Creates an operation from a single operation code.
createCoordinateReferenceSystem
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException(Code)
Returns the direct dependencies. The returned list contains the backing store specified
at construction time, or the exception if the backing store can't be obtained.
Returns a generic object factory to use for the specified code. The default implementation
returns one of the factory specified at construction time. Subclasses can override
this method in order to select a different factory implementation depending on the
code value.
Note: The value of the
code argument given to this
method may be
null when a factory is needed for some global task,
like
AuthorityFactoryAdapter.getAuthorityCodes method execution.
Parameters: code - The authority code given to this class. Note that the code to be givento the returned factory . A factory for the specified authority code (never null ). throws: FactoryException - if no suitable factory were found. since: 2.4
Returns a description of the underlying backing store, or
null if unknow.
throws: FactoryException - if a failure occured while fetching the engine description.
Returns the coordinate reference system factory to use for the specified code. The default
implementation always returns the factory specified at construction time. Subclasses can
override this method in order to select a different factory implementation depending on
the code value.
Parameters: code - The authority code given to this class. Note that the code to be givento the returned factory . A factory for the specified authority code (never null ). throws: FactoryException - if no coordinate reference system factory were specifiedat construction time. since: 2.4
Returns the coordinate system factory to use for the specified code. The default
implementation always returns the factory specified at construction time. Subclasses
can override this method in order to select a different factory implementation
depending on the code value.
Parameters: code - The authority code given to this class. Note that the code to be givento the returned factory . A factory for the specified authority code (never null ). throws: FactoryException - if no coordinate system factory were specified at construction time. since: 2.4
Returns the coordinate operation factory to use for the specified code. The default
implementation always returns the factory specified at construction time. Subclasses can
override this method in order to select a different factory implementation depending on
the code value.
Parameters: code - The authority code given to this class. Note that the code to be givento the returned factory . A factory for the specified authority code (never null ). throws: FactoryException - if no coordinate operation factory were specifiedat construction time. since: 2.4
getCoordinateOperationFactory
final CoordinateOperationFactory getCoordinateOperationFactory() throws FactoryException(Code)
Returns a coordinate operation factory for this adapter. This method will try to fetch
this information from the coordinate operation authority factory, or will returns the
default one if no explicit factory were found.
Returns the datum factory to use for the specified code. The default implementation
always returns the factory specified at construction time. Subclasses can override
this method in order to select a different factory implementation depending on the
code value.
Parameters: code - The authority code given to this class. Note that the code to be givento the returned factory . A factory for the specified authority code (never null ). throws: FactoryException - if no datum factory were specified at construction time. since: 2.4
getDescriptionText
public InternationalString getDescriptionText(String code) throws FactoryException(Code)
Returns a description for the object identified by the specified code.
Suggests a low-level factory group. If
crs is
true , then this method will
try to fetch the factory group from the CRS authority factory. Otherwise it will try to
fetch the factory group from the CS authority factory. This is used by subclasses like
TransformedAuthorityFactory that need low-level access to factories. Do not change
this method into a public one; we would need a better API before to do such thing.
Returns a finder which can be used for looking up unidentified objects.
The default implementation delegates the lookups to the underlying factory.
since: 2.4
Returns
true if this factory is ready for use. This default implementation
checks the availability of CRS, CS, datum and operation authority factories specified
at construction time.
If this factory is a wrapper for the specified factory that do not add any additional
, returns
true . This method is
for
FallbackAuthorityFactory internal use only and should not be public. We
expect only a simple check, so we don't invoke the
getFooAuthorityFactory(...) methods.
Returns the code to be given to the wrapped factories. This method is automatically
invoked by all
create methods before to forward the code to the
,
,
or
factory. The default implementation returns the
code unchanged.
Parameters: code - The code given to this factory. The code to give to the underlying factories. throws: FactoryException - if the code can't be converted. since: 2.4
Methods inherited from org.geotools.referencing.factory.AbstractAuthorityFactory