A factory which delegates all object creation to a primary factory,
and fallback on an other one if the primary factory failed.
since: 2.3 version: $Id: FallbackAuthorityFactory.java 29124 2008-02-07 08:22:48Z aaime $ author: Martin DesruisseauxAuthorityFactory
Constructor Summary
protected
FallbackAuthorityFactory(AuthorityFactory primary, AuthorityFactory fallback) Wraps a primary and a fallback authority factories.
Method Summary
static boolean
chainable(AuthorityFactory primary, AuthorityFactory fallback) Returns
true if the two specified factories can be used in a
FallbackAuthorityFactory .
Wraps a primary and a fallback authority factories.
This constructor is protected because subclasses must declare which of the
DatumAuthorityFactory ,
CSAuthorityFactory ,
CRSAuthorityFactory and
CoordinateOperationAuthorityFactory interfaces they choose to implement.
Parameters: primary - The primary factory. Parameters: fallback - The factory to use as a fallback if the primary factory failed. See Also:FallbackAuthorityFactory.create
Returns
true if the two specified factories can be used in a
FallbackAuthorityFactory . If this method returns
false ,
then we should not create instance of this class since it would be useless.
Wraps the specified authority factories. If the specified collection contains more than
one element, then a chain of
FallbackAuthorityFactory instances is created.
Parameters: type - The interface to implement. Should be one of DatumAuthorityFactory,CSAuthorityFactory, CRSAuthorityFactory orCoordinateOperationAuthorityFactory. Parameters: factories - The factories to wrap, in iteration order. throws: FactoryNotFoundException - if the collection doesn't contains at least one element. throws: ClassCastException - if type is illegal.
Wraps the specified authority factories. If the specified collection contains more than
one element, then a chain of
FallbackAuthorityFactory instances is created. The
type is inferred from the factories found in the collection.
Consider using
(type, factories)
instead when the type is known at compile time.
Parameters: factories - The factories to wrap, in iteration order. throws: FactoryNotFoundException - if the collection doesn't contains at least one element. since: 2.4
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 an arbitrary
from a code.
createCoordinateSystem
public CoordinateSystem createCoordinateSystem(String code) throws FactoryException(Code)
Returns an arbitrary
from a code.
createCoordinateSystemAxis
public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException(Code)
Returns a
from a code.
createCylindricalCS
public CylindricalCS createCylindricalCS(String code) throws FactoryException(Code)
Creates a cylindrical coordinate system from a code.
createDatum
public org.opengis.referencing.datum.Datum createDatum(String code) throws FactoryException(Code)
Returns an arbitrary
from a code.
createDerivedCRS
public DerivedCRS createDerivedCRS(String code) throws FactoryException(Code)
Creates a derived coordinate reference system from a code.
createEllipsoid
public Ellipsoid createEllipsoid(String code) throws FactoryException(Code)
Returns an
from a code.
createEllipsoidalCS
public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException(Code)
Creates an ellipsoidal coordinate system from a code.
createEngineeringCRS
public EngineeringCRS createEngineeringCRS(String code) throws FactoryException(Code)
Creates a
from a code.
createEngineeringDatum
public EngineeringDatum createEngineeringDatum(String code) throws FactoryException(Code)
Creates a
from a code.
createExtent
public Extent createExtent(String code) throws FactoryException(Code)
Returns a
(usually an area of validity) from a code.
Returns the direct dependencies. The returned list contains the backing store and the
fallback specified at construction time, or the exception if they can't be obtained.
Returns the set of authority codes for the specified type. The default implementation
returns the union of the authority codes from the primary and the
fallback factories.
getDescriptionText
public InternationalString getDescriptionText(String code) throws FactoryException(Code)
Returns a description for the object identified by the specified code.
Returns the number of time the primary factory failed and the fallback factory was
used instead. This information is provided mostly for debugging and testing purpose.
It is approximative because incrementation is not sychronized.
Returns a finder which can be used for looking up unidentified objects.
The default implementation delegates the lookups to the primary factory,
and fallback on the second one if the primary factory can't find a match.
since: 2.4
Fields inherited from org.geotools.referencing.factory.AuthorityFactoryAdapter
final protected CRSAuthorityFactory crsFactory(Code)(Java Doc) final protected CSAuthorityFactory csFactory(Code)(Java Doc) final protected DatumAuthorityFactory datumFactory(Code)(Java Doc) final protected CoordinateOperationAuthorityFactory operationFactory(Code)(Java Doc)
Methods inherited from org.geotools.referencing.factory.AuthorityFactoryAdapter
public CartesianCS createCartesianCS(String code) throws FactoryException(Code)(Java Doc) public CompoundCRS createCompoundCRS(String code) throws FactoryException(Code)(Java Doc) public CoordinateOperation createCoordinateOperation(String code) throws FactoryException(Code)(Java Doc) public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException(Code)(Java Doc) public CoordinateSystem createCoordinateSystem(String code) throws FactoryException(Code)(Java Doc) public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException(Code)(Java Doc) public CylindricalCS createCylindricalCS(String code) throws FactoryException(Code)(Java Doc) public Datum createDatum(String code) throws FactoryException(Code)(Java Doc) public DerivedCRS createDerivedCRS(String code) throws FactoryException(Code)(Java Doc) public Ellipsoid createEllipsoid(String code) throws FactoryException(Code)(Java Doc) public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException(Code)(Java Doc) public EngineeringCRS createEngineeringCRS(String code) throws FactoryException(Code)(Java Doc) public EngineeringDatum createEngineeringDatum(String code) throws FactoryException(Code)(Java Doc) public Extent createExtent(String code) throws FactoryException(Code)(Java Doc) publicSet createFromCoordinateReferenceSystemCodes(String sourceCode, String targetCode) throws FactoryException(Code)(Java Doc) public GeocentricCRS createGeocentricCRS(String code) throws FactoryException(Code)(Java Doc) public GeodeticDatum createGeodeticDatum(String code) throws FactoryException(Code)(Java Doc) public GeographicCRS createGeographicCRS(String code) throws FactoryException(Code)(Java Doc) public ImageCRS createImageCRS(String code) throws FactoryException(Code)(Java Doc) public ImageDatum createImageDatum(String code) throws FactoryException(Code)(Java Doc) public IdentifiedObject createObject(String code) throws FactoryException(Code)(Java Doc) public OperationMethod createOperationMethod(String code) throws FactoryException(Code)(Java Doc) public ParameterDescriptor createParameterDescriptor(String code) throws FactoryException(Code)(Java Doc) public PolarCS createPolarCS(String code) throws FactoryException(Code)(Java Doc) public PrimeMeridian createPrimeMeridian(String code) throws FactoryException(Code)(Java Doc) public ProjectedCRS createProjectedCRS(String code) throws FactoryException(Code)(Java Doc) public SphericalCS createSphericalCS(String code) throws FactoryException(Code)(Java Doc) public TemporalCRS createTemporalCRS(String code) throws FactoryException(Code)(Java Doc) public TemporalDatum createTemporalDatum(String code) throws FactoryException(Code)(Java Doc) public TimeCS createTimeCS(String code) throws FactoryException(Code)(Java Doc) public Unit createUnit(String code) throws FactoryException(Code)(Java Doc) public VerticalCRS createVerticalCRS(String code) throws FactoryException(Code)(Java Doc) public VerticalCS createVerticalCS(String code) throws FactoryException(Code)(Java Doc) public VerticalDatum createVerticalDatum(String code) throws FactoryException(Code)(Java Doc) Collection dependencies()(Code)(Java Doc) public Citation getAuthority()(Code)(Java Doc) publicSet getAuthorityCodes(Class type) throws FactoryException(Code)(Java Doc) AuthorityFactory getAuthorityFactory(Class type, String code) throws FactoryException(Code)(Java Doc) protected AuthorityFactory getAuthorityFactory(String code) throws FactoryException(Code)(Java Doc) publicString getBackingStoreDescription() throws FactoryException(Code)(Java Doc) protected CRSAuthorityFactory getCRSAuthorityFactory(String code) throws FactoryException(Code)(Java Doc) protected CSAuthorityFactory getCSAuthorityFactory(String code) throws FactoryException(Code)(Java Doc) protected CoordinateOperationAuthorityFactory getCoordinateOperationAuthorityFactory(String code) throws FactoryException(Code)(Java Doc) final CoordinateOperationFactory getCoordinateOperationFactory() throws FactoryException(Code)(Java Doc) protected DatumAuthorityFactory getDatumAuthorityFactory(String code) throws FactoryException(Code)(Java Doc) public InternationalString getDescriptionText(String code) throws FactoryException(Code)(Java Doc) final ReferencingFactoryContainer getFactoryContainer(boolean crs)(Code)(Java Doc) publicIdentifiedObjectFinder getIdentifiedObjectFinder(Class type) throws FactoryException(Code)(Java Doc) public Citation getVendor()(Code)(Java Doc) public boolean isAvailable()(Code)(Java Doc) final boolean isCodeMethodOverriden()(Code)(Java Doc) Unit replace(Unit units) throws FactoryException(Code)(Java Doc) CoordinateSystemAxis replace(CoordinateSystemAxis axis) throws FactoryException(Code)(Java Doc) CoordinateSystem replace(CoordinateSystem cs) throws FactoryException(Code)(Java Doc) Datum replace(Datum datum) throws FactoryException(Code)(Java Doc) CoordinateReferenceSystem replace(CoordinateReferenceSystem crs) throws FactoryException(Code)(Java Doc) CoordinateOperation replace(CoordinateOperation operation) throws FactoryException(Code)(Java Doc) boolean sameAuthorityCodes(AuthorityFactory factory)(Code)(Java Doc) static boolean sameAuthorityCodes(AuthorityFactory backingStore, AuthorityFactory factory)(Code)(Java Doc) protectedString toBackingFactoryCode(String code) throws FactoryException(Code)(Java Doc)
Methods inherited from org.geotools.referencing.factory.AbstractAuthorityFactory