public class FallbackAuthorityFactory extends AuthorityFactoryAdapter
LOGGER
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
Modifier | Constructor and Description |
---|---|
protected |
FallbackAuthorityFactory(AuthorityFactory primary,
AuthorityFactory fallback)
Wraps a primary and a fallback authority factories.
|
Modifier and Type | Method and Description |
---|---|
static <T extends AuthorityFactory> |
create(Class<T> type,
Collection<T> factories)
Wraps the specified authority factories.
|
static AuthorityFactory |
create(Collection<? extends AuthorityFactory> factories)
Wraps the specified authority factories.
|
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.
|
Set<String> |
getAuthorityCodes(Class<? extends IdentifiedObject> type)
Returns the set of authority codes for the specified type.
|
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.
|
dispose, getAuthority, getAuthorityFactory, getBackingStoreDescription, getCoordinateOperationAuthorityFactory, getCRSAuthorityFactory, getCSAuthorityFactory, getDatumAuthorityFactory, getVendor, isAvailable, toBackingFactoryCode
noSuchAuthorityCode, trimAuthority
ensureNonNull
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
getImplementationHints
protected FallbackAuthorityFactory(AuthorityFactory primary, AuthorityFactory fallback)
This constructor is protected because subclasses must declare which of the DatumAuthorityFactory
, CSAuthorityFactory
, CRSAuthorityFactory
and CoordinateOperationAuthorityFactory
interfaces they choose to implement.
primary
- The primary factory.fallback
- The factory to use as a fallback if the primary factory failed.create(java.lang.Class<T>, java.util.Collection<T>)
public static <T extends AuthorityFactory> T create(Class<T> type, Collection<T> factories) throws FactoryNotFoundException, ClassCastException
FallbackAuthorityFactory
instances is created.T
- The interface to implement.type
- The interface to implement. Should be one of DatumAuthorityFactory
,
CSAuthorityFactory
, CRSAuthorityFactory
or CoordinateOperationAuthorityFactory
.factories
- The factories to wrap, in iteration order.FactoryNotFoundException
- if the collection doesn't contains at least one element.ClassCastException
- if type
is illegal.FactoryNotFoundException
public static AuthorityFactory create(Collection<? extends AuthorityFactory> factories) throws FactoryNotFoundException
FallbackAuthorityFactory
instances is created. The type is
inferred from the factories found in the collection.
Consider using create(type, factories)
instead when the type is known at compile time.
factories
- The factories to wrap, in iteration order.FactoryNotFoundException
- if the collection doesn't contains at least one element.FactoryNotFoundException
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException
getAuthorityCodes
in interface AuthorityFactory
getAuthorityCodes
in class AuthorityFactoryAdapter
type
- The spatial reference objects type.FactoryException
- if access to the underlying database failed.public InternationalString getDescriptionText(String code) throws FactoryException
getDescriptionText
in interface AuthorityFactory
getDescriptionText
in class AuthorityFactoryAdapter
code
- Value allocated by authority.null
if the object corresponding to the
specified code
has no description.NoSuchAuthorityCodeException
- if the specified code
was not found.FactoryException
- if the query failed for some other reason.public IdentifiedObject createObject(String code) throws FactoryException
createObject
in interface AuthorityFactory
createObject
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed.AuthorityFactoryAdapter.createCoordinateReferenceSystem(java.lang.String)
,
AuthorityFactoryAdapter.createDatum(java.lang.String)
,
AuthorityFactoryAdapter.createEllipsoid(java.lang.String)
,
AuthorityFactoryAdapter.createUnit(java.lang.String)
public Datum createDatum(String code) throws FactoryException
createDatum
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createGeodeticDatum(java.lang.String)
,
AuthorityFactoryAdapter.createVerticalDatum(java.lang.String)
,
AuthorityFactoryAdapter.createTemporalDatum(java.lang.String)
public EngineeringDatum createEngineeringDatum(String code) throws FactoryException
createEngineeringDatum
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createEngineeringCRS(java.lang.String)
public ImageDatum createImageDatum(String code) throws FactoryException
createImageDatum
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createImageCRS(java.lang.String)
public VerticalDatum createVerticalDatum(String code) throws FactoryException
createVerticalDatum
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createVerticalCRS(java.lang.String)
public TemporalDatum createTemporalDatum(String code) throws FactoryException
createTemporalDatum
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createTemporalCRS(java.lang.String)
public GeodeticDatum createGeodeticDatum(String code) throws FactoryException
createGeodeticDatum
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createEllipsoid(java.lang.String)
,
AuthorityFactoryAdapter.createPrimeMeridian(java.lang.String)
,
AuthorityFactoryAdapter.createGeographicCRS(java.lang.String)
,
AuthorityFactoryAdapter.createProjectedCRS(java.lang.String)
public Ellipsoid createEllipsoid(String code) throws FactoryException
createEllipsoid
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createGeodeticDatum(java.lang.String)
public PrimeMeridian createPrimeMeridian(String code) throws FactoryException
createPrimeMeridian
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createGeodeticDatum(java.lang.String)
public Extent createExtent(String code) throws FactoryException
createExtent
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public CoordinateSystem createCoordinateSystem(String code) throws FactoryException
createCoordinateSystem
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public CartesianCS createCartesianCS(String code) throws FactoryException
createCartesianCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public PolarCS createPolarCS(String code) throws FactoryException
createPolarCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public CylindricalCS createCylindricalCS(String code) throws FactoryException
createCylindricalCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public SphericalCS createSphericalCS(String code) throws FactoryException
createSphericalCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException
createEllipsoidalCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public VerticalCS createVerticalCS(String code) throws FactoryException
createVerticalCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public TimeCS createTimeCS(String code) throws FactoryException
createTimeCS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException
createCoordinateSystemAxis
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public Unit<?> createUnit(String code) throws FactoryException
createUnit
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException
createCoordinateReferenceSystem
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AuthorityFactoryAdapter.createGeographicCRS(java.lang.String)
,
AuthorityFactoryAdapter.createProjectedCRS(java.lang.String)
,
AuthorityFactoryAdapter.createVerticalCRS(java.lang.String)
,
AuthorityFactoryAdapter.createTemporalCRS(java.lang.String)
,
AuthorityFactoryAdapter.createCompoundCRS(java.lang.String)
public CompoundCRS createCompoundCRS(String code) throws FactoryException
createCompoundCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public DerivedCRS createDerivedCRS(String code) throws FactoryException
createDerivedCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public EngineeringCRS createEngineeringCRS(String code) throws FactoryException
createEngineeringCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public GeographicCRS createGeographicCRS(String code) throws FactoryException
createGeographicCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public GeocentricCRS createGeocentricCRS(String code) throws FactoryException
createGeocentricCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public ImageCRS createImageCRS(String code) throws FactoryException
createImageCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public ProjectedCRS createProjectedCRS(String code) throws FactoryException
createProjectedCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
public TemporalCRS createTemporalCRS(String code) throws FactoryException
createTemporalCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AbstractAuthorityFactory.createTemporalDatum(java.lang.String)
public VerticalCRS createVerticalCRS(String code) throws FactoryException
createVerticalCRS
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.AbstractAuthorityFactory.createVerticalDatum(java.lang.String)
public ParameterDescriptor createParameterDescriptor(String code) throws FactoryException
createParameterDescriptor
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public OperationMethod createOperationMethod(String code) throws FactoryException
createOperationMethod
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public CoordinateOperation createCoordinateOperation(String code) throws FactoryException
createCoordinateOperation
in class AuthorityFactoryAdapter
code
- Value allocated by authority.FactoryException
- if the object creation failed for all factories.public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS, String targetCRS) throws FactoryException
createFromCoordinateReferenceSystemCodes
in class AuthorityFactoryAdapter
sourceCRS
- Coded value of source coordinate reference system.targetCRS
- Coded value of target coordinate reference system.sourceCRS
to targetCRS
.FactoryException
- if the object creation failed for all factories.public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type) throws FactoryException
getIdentifiedObjectFinder
in class AuthorityFactoryAdapter
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.FactoryException
- if the object creation failed.Copyright © 1996–2019 Geotools. All rights reserved.