|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.factory.AbstractFactory
org.geotools.referencing.factory.ReferencingFactory
org.geotools.referencing.factory.AbstractAuthorityFactory
org.geotools.referencing.factory.AuthorityFactoryAdapter
org.geotools.referencing.factory.ManyAuthoritiesFactory
public class ManyAuthoritiesFactory
An authority factory that delegates the object creation to an other factory determined from the
authority name in the code. This factory requires that every codes given to a createFoo
method are prefixed by the authority name, for example "EPSG:4326"
. This is different
from using a factory from a known authority, in which case the authority part was optional (for
example when using the EPSG authority factory,
the "EPSG:"
part in "EPSG:4326"
is optional).
This class parses the authority name and delegates the work the corresponding factory. For
example if any createFoo(...)
method in this class is invoked with a code starting
by "EPSG:"
, then this class delegates the object creation to one of the authority
factories provided to the constructor.
This class is not registered in ReferencingFactoryFinder
, because it is not a real
authority factory. There is not a single authority name associated to this factory, but rather
a set of names determined from all available authority factories.
Field Summary |
---|
Fields inherited from class org.geotools.referencing.factory.ReferencingFactory |
---|
LOGGER |
Fields inherited from class org.geotools.factory.AbstractFactory |
---|
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority |
Constructor Summary | |
---|---|
ManyAuthoritiesFactory(java.util.Collection<? extends org.opengis.referencing.AuthorityFactory> factories)
Creates a new factory using the specified set of user factories. |
Method Summary | |
---|---|
org.opengis.referencing.IdentifiedObject |
createObject(java.lang.String code)
Returns an arbitrary object from a code. |
org.opengis.metadata.citation.Citation |
getAuthority()
Returns the organization or party responsible for definition and maintenance of the database. |
java.util.Set<java.lang.String> |
getAuthorityCodes(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type)
Returns the set of authority codes of the given type. |
protected org.opengis.referencing.AuthorityFactory |
getAuthorityFactory(java.lang.String code)
Returns a generic object authority factory for the specified "AUTHORITY:NUMBER"
code. |
java.util.Set<java.lang.String> |
getAuthorityNames()
Returns the authority names of every factories given at construction time. |
java.lang.String |
getBackingStoreDescription()
Returns a description of the underlying backing store, or null if unknow. |
protected org.opengis.referencing.operation.CoordinateOperationAuthorityFactory |
getCoordinateOperationAuthorityFactory(java.lang.String code)
Returns the operation authority factory for the specified "AUTHORITY:NUMBER" code. |
protected org.opengis.referencing.crs.CRSAuthorityFactory |
getCRSAuthorityFactory(java.lang.String code)
Returns the CRS authority factory for the specified "AUTHORITY:NUMBER" code. |
protected org.opengis.referencing.cs.CSAuthorityFactory |
getCSAuthorityFactory(java.lang.String code)
Returns the CS authority factory for the specified "AUTHORITY:NUMBER" code. |
protected org.opengis.referencing.datum.DatumAuthorityFactory |
getDatumAuthorityFactory(java.lang.String code)
Returns the datum authority factory for the specified "AUTHORITY:NUMBER" code. |
org.opengis.util.InternationalString |
getDescriptionText(java.lang.String code)
Gets a description of the object corresponding to a code. |
IdentifiedObjectFinder |
getIdentifiedObjectFinder(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type)
Returns a finder which can be used for looking up unidentified objects. |
protected char |
getSeparator(java.lang.String code)
Returns the character separator for the specified code. |
org.opengis.metadata.citation.Citation |
getVendor()
Returns the vendor responsible for creating this factory implementation. |
Methods inherited from class org.geotools.referencing.factory.AbstractAuthorityFactory |
---|
noSuchAuthorityCode, trimAuthority |
Methods inherited from class org.geotools.referencing.factory.ReferencingFactory |
---|
ensureNonNull |
Methods inherited from class org.geotools.factory.AbstractFactory |
---|
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.opengis.referencing.crs.CRSAuthorityFactory |
---|
createCompoundCRS, createCoordinateReferenceSystem, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRS |
Methods inherited from interface org.opengis.referencing.cs.CSAuthorityFactory |
---|
createCartesianCS, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createEllipsoidalCS, createPolarCS, createSphericalCS, createTimeCS, createUnit, createVerticalCS |
Methods inherited from interface org.opengis.referencing.datum.DatumAuthorityFactory |
---|
createDatum, createEllipsoid, createEngineeringDatum, createGeodeticDatum, createImageDatum, createPrimeMeridian, createTemporalDatum, createVerticalDatum |
Methods inherited from interface org.opengis.referencing.operation.CoordinateOperationAuthorityFactory |
---|
createCoordinateOperation, createFromCoordinateReferenceSystemCodes |
Methods inherited from interface org.geotools.factory.Factory |
---|
getImplementationHints |
Constructor Detail |
---|
public ManyAuthoritiesFactory(java.util.Collection<? extends org.opengis.referencing.AuthorityFactory> factories)
createFoo(code)
method will scan the supplied factories in their iteration
order. The first factory implementing the appropriate interface and having the expected
authority name will be used.
If the factories
collection contains more than one factory for the same authority
and interface, then all additional factories will be fallbacks, to be tried in iteration order only if the first acceptable factory failed to
create the requested object.
factories
- A set of user-specified factories to try before to delegate
to GeometryFactoryFinder
.Method Detail |
---|
protected char getSeparator(java.lang.String code)
':'
, except
if the code looks like a URL (e.g. "http://www.opengis.net/"
), in which case this
method returns '/'
.
In the current implementation, "looks like a URL" means that the first
non-aplhanumeric characters
are "://"
. But this heuristic rule may change in future implementations.
public org.opengis.metadata.citation.Citation getVendor()
getVendor
in class AuthorityFactoryAdapter
public org.opengis.metadata.citation.Citation getAuthority()
getAuthority
in interface org.opengis.referencing.AuthorityFactory
getAuthority
in class AuthorityFactoryAdapter
public java.util.Set<java.lang.String> getAuthorityNames()
public java.lang.String getBackingStoreDescription() throws org.opengis.referencing.FactoryException
null
if unknow.
getBackingStoreDescription
in class AuthorityFactoryAdapter
null
.
org.opengis.referencing.FactoryException
- if a failure occured while fetching the engine description.protected org.opengis.referencing.AuthorityFactory getAuthorityFactory(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
"AUTHORITY:NUMBER"
code.
getAuthorityFactory
in class AuthorityFactoryAdapter
code
- The code to parse.
org.opengis.referencing.NoSuchAuthorityCodeException
- if no authority name has been found.protected org.opengis.referencing.datum.DatumAuthorityFactory getDatumAuthorityFactory(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
"AUTHORITY:NUMBER"
code.
getDatumAuthorityFactory
in class AuthorityFactoryAdapter
code
- The code to parse.
org.opengis.referencing.NoSuchAuthorityCodeException
- if no authority name has been found.protected org.opengis.referencing.cs.CSAuthorityFactory getCSAuthorityFactory(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
"AUTHORITY:NUMBER"
code.
getCSAuthorityFactory
in class AuthorityFactoryAdapter
code
- The code to parse.
org.opengis.referencing.NoSuchAuthorityCodeException
- if no authority name has been found.protected org.opengis.referencing.crs.CRSAuthorityFactory getCRSAuthorityFactory(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
"AUTHORITY:NUMBER"
code.
getCRSAuthorityFactory
in class AuthorityFactoryAdapter
code
- The code to parse.
org.opengis.referencing.NoSuchAuthorityCodeException
- if no authority name has been found.protected org.opengis.referencing.operation.CoordinateOperationAuthorityFactory getCoordinateOperationAuthorityFactory(java.lang.String code) throws org.opengis.referencing.NoSuchAuthorityCodeException
"AUTHORITY:NUMBER"
code.
getCoordinateOperationAuthorityFactory
in class AuthorityFactoryAdapter
code
- The code to parse.
org.opengis.referencing.NoSuchAuthorityCodeException
- if no authority name has been found.public java.util.Set<java.lang.String> getAuthorityCodes(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type) throws org.opengis.referencing.FactoryException
getAuthorityCodes
in interface org.opengis.referencing.AuthorityFactory
getAuthorityCodes
in class AuthorityFactoryAdapter
type
- The spatial reference objects type (may be IdentifiedObject.class
).
org.opengis.referencing.FactoryException
- if access to the underlying database failed.public org.opengis.util.InternationalString getDescriptionText(java.lang.String code) throws org.opengis.referencing.FactoryException
getDescriptionText
in interface org.opengis.referencing.AuthorityFactory
getDescriptionText
in class AuthorityFactoryAdapter
code
- Value allocated by authority.
null
if the object
corresponding to the specified code
has no description.
org.opengis.referencing.NoSuchAuthorityCodeException
- if the specified code
was not found.
org.opengis.referencing.FactoryException
- if the query failed for some other reason.public org.opengis.referencing.IdentifiedObject createObject(java.lang.String code) throws org.opengis.referencing.FactoryException
createObject
in interface org.opengis.referencing.AuthorityFactory
createObject
in class AuthorityFactoryAdapter
code
- Value allocated by authority.
org.opengis.referencing.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 IdentifiedObjectFinder getIdentifiedObjectFinder(java.lang.Class<? extends org.opengis.referencing.IdentifiedObject> type) throws org.opengis.referencing.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.
org.opengis.referencing.FactoryException
- if the object creation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |