|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFactory
ReferencingFactory
AbstractAuthorityFactory
@ThreadSafe public abstract class AbstractAuthorityFactory
Base class for authority factories. An authority is an organization that maintains
definitions of authority codes. An authority code is a compact string defined by
an authority to reference a particular spatial reference object. For example the
European Petroleum Survey Group (EPSG) maintains
a database of coordinate systems, and other spatial referencing objects, where each
object has a code number ID. For example, the EPSG code for a WGS84 Lat/Lon coordinate
system is "4326".
This class defines a default implementation for most methods defined in the
DatumAuthorityFactory, CSAuthorityFactory and CRSAuthorityFactory
interfaces. However, those interfaces do not appear in the implements clause of
this class declaration. This is up to subclasses to decide which interfaces they declare
to implement.
The default implementation for all createFoo methods ultimately invokes
createObject(java.lang.String), which may be the only method that a subclass need to override.
However, other methods may be overridden as well for better performances.
| referencing/geotk-referencing (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Factory |
|---|
Factory.Availability, Factory.Organizer |
| Field Summary | |
|---|---|
protected NameFactory |
nameFactory
The name factory to use for creating GenericName. |
| Fields inherited from class ReferencingFactory |
|---|
LOGGER |
| Fields inherited from class Factory |
|---|
EMPTY_HINTS, hints |
| Constructor Summary | |
|---|---|
protected |
AbstractAuthorityFactory(Hints userHints)
Constructs a new authority factory. |
| 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. |
protected void |
dispose(boolean shutdown)
Releases resources immediately instead of waiting for the garbage collector. |
abstract Citation |
getAuthority()
Returns the organization or party responsible for definition and maintenance of the database. |
String |
getBackingStoreDescription()
Returns a description of the underlying backing store, or null if unknown. |
IdentifiedObjectFinder |
getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
Returns a finder which can be used for looking up unidentified objects. |
protected NoSuchAuthorityCodeException |
noSuchAuthorityCode(Class<?> type,
String code)
Creates an exception for an unknown authority code. |
protected String |
trimAuthority(String code)
Trims the authority scope, if presents. |
| Methods inherited from class ReferencingFactory |
|---|
ensureNonNull, getVendor |
| Methods inherited from class Factory |
|---|
availability, equals, getImplementationHints, hasCompatibleHints, hashCode, setOrdering, toString |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface AuthorityFactory |
|---|
getAuthorityCodes, getDescriptionText |
| Methods inherited from interface Factory |
|---|
getVendor |
| Field Detail |
|---|
protected final NameFactory nameFactory
GenericName.
| Constructor Detail |
|---|
protected AbstractAuthorityFactory(Hints userHints)
userHints - An optional set of hints, or null for the default ones.| Method Detail |
|---|
public abstract Citation getAuthority()
getAuthority in interface AuthorityFactory
public String getBackingStoreDescription()
throws FactoryException
null if unknown.
This is for example the database software used for storing the data.
The default implementation returns always null.
null.
FactoryException - if a failure occurs while fetching the engine description.
public IdentifiedObject createObject(String code)
throws NoSuchAuthorityCodeException,
FactoryException
Datum, CoordinateSystem, CoordinateReferenceSystem or
CoordinateOperation. The default implementation always throw an exception.
Subclasses should override this method if they are capable to automatically detect
the object type from its code.
createObject in interface AuthorityFactorycode - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public Datum createDatum(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public EngineeringDatum createEngineeringDatum(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createDatum(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public ImageDatum createImageDatum(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createDatum(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public VerticalDatum createVerticalDatum(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createDatum(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public TemporalDatum createTemporalDatum(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createDatum(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public GeodeticDatum createGeodeticDatum(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createDatum(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public Ellipsoid createEllipsoid(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public PrimeMeridian createPrimeMeridian(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public Extent createExtent(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CoordinateSystem createCoordinateSystem(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CartesianCS createCartesianCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public PolarCS createPolarCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CylindricalCS createCylindricalCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public SphericalCS createSphericalCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public EllipsoidalCS createEllipsoidalCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public VerticalCS createVerticalCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public TimeCS createTimeCS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createCoordinateSystem(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CoordinateSystemAxis createCoordinateSystemAxis(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public Unit<?> createUnit(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createObject(code).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code)
throws NoSuchAuthorityCodeException,
FactoryException
createGeographicCRS(code)
instead of createCoordinateReferenceSystem(code) if the caller
know he is asking for a geographic coordinate reference system).
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CompoundCRS createCompoundCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public DerivedCRS createDerivedCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public EngineeringCRS createEngineeringCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public GeographicCRS createGeographicCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public GeocentricCRS createGeocentricCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed.
public ImageCRS createImageCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public ProjectedCRS createProjectedCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public TemporalCRS createTemporalCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public VerticalCRS createVerticalCRS(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public ParameterDescriptor<?> createParameterDescriptor(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public OperationMethod createOperationMethod(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public CoordinateOperation createCoordinateOperation(String code)
throws NoSuchAuthorityCodeException,
FactoryException
code - Value allocated by authority.
NoSuchAuthorityCodeException - if the specified code was not found.
FactoryException - if the object creation failed for some other reason.
public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCRS,
String targetCRS)
throws NoSuchAuthorityCodeException,
FactoryException
Rational: Coordinate operation factory backed by an authority will invoke this method. If this method invoked the coordinate operation factory in turn, the application could be trapped in infinite recursive calls.
sourceCRS - Coded value of source coordinate reference system.targetCRS - Coded value of target coordinate reference system.
sourceCRS to targetCRS.
NoSuchAuthorityCodeException - if a specified code was not found.
FactoryException - if the object creation failed for some other reason.
public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
throws FactoryException
AUTHORITY[...]" element in
Well Known Text terminology.
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 (for example the factories backed
by EPSG databases).
FactoryException - if the finder can not be created.protected void dispose(boolean shutdown)
create(...) invocations
may throw a FactoryException. Disposing a previously-disposed factory,
however, has no effect.
dispose in class Factoryprotected String trimAuthority(String code)
"EPSG:" prefix, then the prefix is
removed. Otherwise, the string is returned unchanged (except for leading and trailing spaces).
code - The code to trim.
protected final NoSuchAuthorityCodeException noSuchAuthorityCode(Class<?> type,
String code)
createXXX methods.
type - The GeoAPI interface that was to be created
(e.g. CoordinateReferenceSystem.class).code - The unknown authority code.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||