org.geotools.referencing.factory
Class AuthorityFactoryAdapter

Object
  extended by AbstractFactory
      extended by ReferencingFactory
          extended by AbstractAuthorityFactory
              extended by AuthorityFactoryAdapter
All Implemented Interfaces:
RegisterableService, Factory, OptionalFactory, AuthorityFactory
Direct Known Subclasses:
FallbackAuthorityFactory, HTTP_AuthorityFactory, ManyAuthoritiesFactory, TransformedAuthorityFactory, URN_AuthorityFactory

public class AuthorityFactoryAdapter
extends AbstractAuthorityFactory
implements OptionalFactory

An authority factory which delegates CRS, CS or datum 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
Author:
Martin Desruisseaux (IRD)
Module:
modules/library/referencing (gt-referencing.jar)

Field Summary
 
Fields inherited from class ReferencingFactory
LOGGER
 
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
 
Constructor Summary
protected AuthorityFactoryAdapter(AuthorityFactory factory)
          Creates a wrapper around the specified factory.
protected 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.
 
Method Summary
 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.
 Citation getAuthority()
          Returns the organization or party responsible for definition and maintenance of the database.
 Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type)
          Returns the set of authority code for the specified type.
protected  AuthorityFactory getAuthorityFactory(String code)
          Returns a generic object factory to use for the specified code.
 String getBackingStoreDescription()
          Returns a description of the underlying backing store, or null if unknow.
protected  CoordinateOperationAuthorityFactory getCoordinateOperationAuthorityFactory(String code)
          Returns the coordinate operation factory to use for the specified code.
protected  CRSAuthorityFactory getCRSAuthorityFactory(String code)
          Returns the coordinate reference system factory to use for the specified code.
protected  CSAuthorityFactory getCSAuthorityFactory(String code)
          Returns the coordinate system factory to use for the specified code.
protected  DatumAuthorityFactory getDatumAuthorityFactory(String code)
          Returns the datum factory to use for the specified code.
 InternationalString getDescriptionText(String code)
          Returns a description for the object identified by the specified code.
 IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
          Returns a finder which can be used for looking up unidentified objects.
 Citation getVendor()
          Returns the vendor responsible for creating this factory implementation.
 boolean isAvailable()
          Returns true if this factory is ready for use.
protected  String toBackingFactoryCode(String code)
          Returns the code to be given to the wrapped factories.
 
Methods inherited from class AbstractAuthorityFactory
noSuchAuthorityCode, trimAuthority
 
Methods inherited from class ReferencingFactory
ensureNonNull
 
Methods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface Factory
getImplementationHints
 

Constructor Detail

AuthorityFactoryAdapter

protected AuthorityFactoryAdapter(AuthorityFactory factory)
Creates a wrapper around the specified factory. The priority field will be set to the same value than the specified factory. Subclasses should override the getPriority() method if they want to set a higher or lower priority for this instance.

Parameters:
factory - The factory to wrap.

AuthorityFactoryAdapter

protected AuthorityFactoryAdapter(CRSAuthorityFactory crsFactory,
                                  CSAuthorityFactory csFactory,
                                  DatumAuthorityFactory datumFactory,
                                  CoordinateOperationAuthorityFactory opFactory)
Creates a wrapper around the specified factories. The priority field will be set to the highest priority found in the specified factories. Subclasses should override the getPriority() method if they want to set a higher or lower priority for this instance.

Parameters:
crsFactory - The coordinate reference system authority factory, or null.
csFactory - The coordinate system authority factory, or null.
datumFactory - The datum authority factory, or null.
opFactory - The coordinate operation authority factory, or null.

AuthorityFactoryAdapter

protected AuthorityFactoryAdapter(String authority,
                                  Hints userHints)
                           throws FactoryRegistryException
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 the set of hints.
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

isAvailable

public boolean isAvailable()
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.

Specified by:
isAvailable in interface OptionalFactory
Returns:
true if this factory is ready for use.

getBackingStoreDescription

public String getBackingStoreDescription()
                                  throws FactoryException
Returns a description of the underlying backing store, or null if unknow.

Overrides:
getBackingStoreDescription in class AbstractAuthorityFactory
Returns:
The description of the underlying backing store, or null.
Throws:
FactoryException - if a failure occured while fetching the engine description.

getVendor

public Citation getVendor()
Returns the vendor responsible for creating this factory implementation.

Overrides:
getVendor in class ReferencingFactory
Returns:
The vendor for this factory implementation.

getAuthority

public Citation getAuthority()
Returns the organization or party responsible for definition and maintenance of the database.

Specified by:
getAuthority in interface AuthorityFactory
Specified by:
getAuthority in class AbstractAuthorityFactory

getAuthorityCodes

public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type)
                              throws FactoryException
Returns the set of authority code for the specified type.

Specified by:
getAuthorityCodes in interface AuthorityFactory
Throws:
FactoryException

getDescriptionText

public InternationalString getDescriptionText(String code)
                                       throws FactoryException
Returns a description for the object identified by the specified code.

Specified by:
getDescriptionText in interface AuthorityFactory
Throws:
FactoryException

createObject

public IdentifiedObject createObject(String code)
                              throws FactoryException
Returns an arbitrary object from a code.

Specified by:
createObject in interface AuthorityFactory
Overrides:
createObject in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Throws:
FactoryException - if the object creation failed.
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 FactoryException
Returns an arbitrary datum from a code.

Overrides:
createDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createGeodeticDatum(java.lang.String), createVerticalDatum(java.lang.String), createTemporalDatum(java.lang.String)

createEngineeringDatum

public EngineeringDatum createEngineeringDatum(String code)
                                        throws FactoryException
Creates a engineering datum from a code.

Overrides:
createEngineeringDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createEngineeringCRS(java.lang.String)

createImageDatum

public ImageDatum createImageDatum(String code)
                            throws FactoryException
Creates a image datum from a code.

Overrides:
createImageDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createImageCRS(java.lang.String)

createVerticalDatum

public VerticalDatum createVerticalDatum(String code)
                                  throws FactoryException
Creates a vertical datum from a code.

Overrides:
createVerticalDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createVerticalCRS(java.lang.String)

createTemporalDatum

public TemporalDatum createTemporalDatum(String code)
                                  throws FactoryException
Creates a temporal datum from a code.

Overrides:
createTemporalDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createTemporalCRS(java.lang.String)

createGeodeticDatum

public GeodeticDatum createGeodeticDatum(String code)
                                  throws FactoryException
Returns a geodetic datum from a code.

Overrides:
createGeodeticDatum in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The datum for the given code.
Throws:
FactoryException - if the object creation failed.
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 FactoryException
Returns an ellipsoid from a code.

Overrides:
createEllipsoid in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The ellipsoid for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createGeodeticDatum(java.lang.String)

createPrimeMeridian

public PrimeMeridian createPrimeMeridian(String code)
                                  throws FactoryException
Returns a prime meridian from a code.

Overrides:
createPrimeMeridian in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The prime meridian for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
createGeodeticDatum(java.lang.String)

createExtent

public Extent createExtent(String code)
                    throws FactoryException
Returns a extent (usually an area of validity) from a code.

Overrides:
createExtent in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The extent for the given code.
Throws:
FactoryException - if the object creation failed.

createCoordinateSystem

public CoordinateSystem createCoordinateSystem(String code)
                                        throws FactoryException
Returns an arbitrary coordinate system from a code.

Overrides:
createCoordinateSystem in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createCartesianCS

public CartesianCS createCartesianCS(String code)
                              throws FactoryException
Creates a cartesian coordinate system from a code.

Overrides:
createCartesianCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createPolarCS

public PolarCS createPolarCS(String code)
                      throws FactoryException
Creates a polar coordinate system from a code.

Overrides:
createPolarCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createCylindricalCS

public CylindricalCS createCylindricalCS(String code)
                                  throws FactoryException
Creates a cylindrical coordinate system from a code.

Overrides:
createCylindricalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createSphericalCS

public SphericalCS createSphericalCS(String code)
                              throws FactoryException
Creates a spherical coordinate system from a code.

Overrides:
createSphericalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createEllipsoidalCS

public EllipsoidalCS createEllipsoidalCS(String code)
                                  throws FactoryException
Creates an ellipsoidal coordinate system from a code.

Overrides:
createEllipsoidalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createVerticalCS

public VerticalCS createVerticalCS(String code)
                            throws FactoryException
Creates a vertical coordinate system from a code.

Overrides:
createVerticalCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createTimeCS

public TimeCS createTimeCS(String code)
                    throws FactoryException
Creates a temporal coordinate system from a code.

Overrides:
createTimeCS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate system for the given code.
Throws:
FactoryException - if the object creation failed.

createCoordinateSystemAxis

public CoordinateSystemAxis createCoordinateSystemAxis(String code)
                                                throws FactoryException
Returns a coordinate system axis from a code.

Overrides:
createCoordinateSystemAxis in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The axis for the given code.
Throws:
FactoryException - if the object creation failed.

createUnit

public Unit<?> createUnit(String code)
                   throws FactoryException
Returns an unit from a code.

Overrides:
createUnit in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The unit for the given code.
Throws:
FactoryException - if the object creation failed.

createCoordinateReferenceSystem

public CoordinateReferenceSystem createCoordinateReferenceSystem(String code)
                                                          throws FactoryException
Returns an arbitrary coordinate reference system from a code.

Overrides:
createCoordinateReferenceSystem in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.
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 FactoryException
Creates a 3D coordinate reference system from a code.

Overrides:
createCompoundCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.

createDerivedCRS

public DerivedCRS createDerivedCRS(String code)
                            throws FactoryException
Creates a derived coordinate reference system from a code.

Overrides:
createDerivedCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.

createEngineeringCRS

public EngineeringCRS createEngineeringCRS(String code)
                                    throws FactoryException
Creates a engineering coordinate reference system from a code.

Overrides:
createEngineeringCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.

createGeographicCRS

public GeographicCRS createGeographicCRS(String code)
                                  throws FactoryException
Returns a geographic coordinate reference system from a code.

Overrides:
createGeographicCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

createGeocentricCRS

public GeocentricCRS createGeocentricCRS(String code)
                                  throws FactoryException
Returns a geocentric coordinate reference system from a code.

Overrides:
createGeocentricCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

createImageCRS

public ImageCRS createImageCRS(String code)
                        throws FactoryException
Creates a image coordinate reference system from a code.

Overrides:
createImageCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.

createProjectedCRS

public ProjectedCRS createProjectedCRS(String code)
                                throws FactoryException
Returns a projected coordinate reference system from a code.

Overrides:
createProjectedCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)

createTemporalCRS

public TemporalCRS createTemporalCRS(String code)
                              throws FactoryException
Creates a temporal coordinate reference system from a code.

Overrides:
createTemporalCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
AbstractAuthorityFactory.createTemporalDatum(java.lang.String)

createVerticalCRS

public VerticalCRS createVerticalCRS(String code)
                              throws FactoryException
Creates a vertical coordinate reference system from a code.

Overrides:
createVerticalCRS in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.
See Also:
AbstractAuthorityFactory.createVerticalDatum(java.lang.String)

createParameterDescriptor

public ParameterDescriptor createParameterDescriptor(String code)
                                              throws FactoryException
Creates a parameter descriptor from a code.

Overrides:
createParameterDescriptor in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The coordinate reference system for the given code.
Throws:
FactoryException - if the object creation failed.

createOperationMethod

public OperationMethod createOperationMethod(String code)
                                      throws FactoryException
Creates an operation method from a code.

Overrides:
createOperationMethod in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The operation method for the given code.
Throws:
FactoryException - if the object creation failed.

createCoordinateOperation

public CoordinateOperation createCoordinateOperation(String code)
                                              throws FactoryException
Creates an operation from a single operation code.

Overrides:
createCoordinateOperation in class AbstractAuthorityFactory
Parameters:
code - Value allocated by authority.
Returns:
The operation for the given code.
Throws:
FactoryException - if the object creation failed.

createFromCoordinateReferenceSystemCodes

public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS,
                                                                         String targetCRS)
                                                                  throws FactoryException
Creates an operation from coordinate reference system codes.

Overrides:
createFromCoordinateReferenceSystemCodes in class AbstractAuthorityFactory
Parameters:
sourceCRS - Coded value of source coordinate reference system.
targetCRS - Coded value of target coordinate reference system.
Returns:
The operations from sourceCRS to targetCRS.
Throws:
FactoryException - if the object creation failed.

getIdentifiedObjectFinder

public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
                                                 throws FactoryException
Returns a finder which can be used for looking up unidentified objects. The default implementation delegates the lookups to the underlying factory.

Overrides:
getIdentifiedObjectFinder in class AbstractAuthorityFactory
Parameters:
type - The type of objects to look for. Should be a GeoAPI interface like GeographicCRS.class, but this method accepts also implementation class. If the type is unknown, use IdentifiedObject.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 object creation failed.
Since:
2.4

getAuthorityFactory

protected AuthorityFactory getAuthorityFactory(String code)
                                        throws FactoryException
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 getAuthorityCodes(java.lang.Class) method execution.

Parameters:
code - The authority code given to this class. Note that the code to be given to the returned factory may be different.
Returns:
A factory for the specified authority code (never null).
Throws:
FactoryException - if no suitable factory were found.
Since:
2.4

getDatumAuthorityFactory

protected DatumAuthorityFactory getDatumAuthorityFactory(String code)
                                                  throws FactoryException
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 given to the returned factory may be different.
Returns:
A factory for the specified authority code (never null).
Throws:
FactoryException - if no datum factory were specified at construction time.
Since:
2.4

getCSAuthorityFactory

protected CSAuthorityFactory getCSAuthorityFactory(String code)
                                            throws FactoryException
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 given to the returned factory may be different.
Returns:
A factory for the specified authority code (never null).
Throws:
FactoryException - if no coordinate system factory were specified at construction time.
Since:
2.4

getCRSAuthorityFactory

protected CRSAuthorityFactory getCRSAuthorityFactory(String code)
                                              throws FactoryException
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 given to the returned factory may be different.
Returns:
A factory for the specified authority code (never null).
Throws:
FactoryException - if no coordinate reference system factory were specified at construction time.
Since:
2.4

getCoordinateOperationAuthorityFactory

protected CoordinateOperationAuthorityFactory getCoordinateOperationAuthorityFactory(String code)
                                                                              throws FactoryException
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 given to the returned factory may be different.
Returns:
A factory for the specified authority code (never null).
Throws:
FactoryException - if no coordinate operation factory were specified at construction time.
Since:
2.4

toBackingFactoryCode

protected String toBackingFactoryCode(String code)
                               throws FactoryException
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 CRS, CS, datum or operation factory. The default implementation returns the code unchanged.

Parameters:
code - The code given to this factory.
Returns:
The code to give to the underlying factories.
Throws:
FactoryException - if the code can't be converted.
Since:
2.4

dispose

public void dispose()
             throws FactoryException
Description copied from class: AbstractAuthorityFactory
Releases resources immediately instead of waiting for the garbage collector. Once a factory has been disposed, further create(...) invocations may throw a FactoryException. Disposing a previously-disposed factory, however, has no effect.

Overrides:
dispose in class AbstractAuthorityFactory
Throws:
FactoryException - if an error occured while disposing the factory.


Copyright © 1996-2010 Geotools. All Rights Reserved.