deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.crs.configuration
Class AbstractCRSProvider<T>

java.lang.Object
  extended by org.deegree.crs.configuration.AbstractCRSProvider<T>
Type Parameters:
T - the type of object the parse method awaits.
All Implemented Interfaces:
CRSProvider
Direct Known Subclasses:
DeegreeCRSProvider, GMLCRSProvider, PROJ4CRSProvider

public abstract class AbstractCRSProvider<T>
extends Object
implements CRSProvider

add class documentation here.

Version:
$Revision: 22634 $, $Date: 2010-02-19 11:32:33 +0100 (Fr, 19 Feb 2010) $
Author:
Rutger Bezema, last edited by: $Author: rbezema $

Nested Class Summary
static class AbstractCRSProvider.SupportedProjectionParameters
          The SupportedProjectionParameters enumeration defines currently supported projection parameters
static class AbstractCRSProvider.SupportedProjections
          The SupportedProjections enumeration defines currently supported projections
static class AbstractCRSProvider.SupportedTransformationParameters
          The SupportedTransformationParameters enumeration defines currently supported transformation parameters
static class AbstractCRSProvider.SupportedTransformations
          The SupportedTransformations enumeration defines currently supported transformations
 
Constructor Summary
AbstractCRSProvider(Properties properties, Class<K> subType, CRSResource<T> defaultResolver)
           
 
Method Summary
<V extends CRSIdentifiable>
V
addIdToCache(V identifiable, boolean update)
          Add the id to the cache, by mapping it to all its identifiers.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(Class<V> expectedType, CRSCodeType id)
          Get a CRSIdentifiable (actually a type V that extends it) from the cache that corresponds to the a CRSCodeType.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(Class<V> expectedType, CRSCodeType[] ids)
          Get a CRSIdentifiable (actually a type V that extends it) from the cache that corresponds to the a CRSCodeType.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(Class<V> expectedType, CRSIdentifiable ids)
          The id are what they are, not trimming 'upcasing' or other modifications will be done in this method.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(Class<V> expectedType, String id)
          The id is as it is, not trimming 'upcasing' or other modifications will be done in this method.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(Class<V> expectedType, String[] ids)
          The id are what they are, not trimming 'upcasing' or other modifications will be done in this method.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(CRSCodeType id)
          Get a CRSIdentifiable (actually a type V that extends it) from the cache that corresponds to the a CRSCodeType.
<V extends CRSIdentifiable>
V
getCachedIdentifiable(String id)
          The id is as it is, not trimming 'upcasing' or other modifications will be done in this method.
 CoordinateSystem getCRSByCode(CRSCodeType id)
          Retrieves the CoordinateSystem from the set provider that is identified by the given CRSCodeType id.
protected  CRSResource<T> getResolver()
           
protected  AbstractCRSProvider.SupportedProjectionParameters mapProjectionParameters(CRSCodeType[] codes)
           
protected  AbstractCRSProvider.SupportedProjections mapProjections(CRSCodeType[] codes)
           
protected  AbstractCRSProvider.SupportedTransformations mapTransformation(CRSCodeType[] codes)
           
protected  AbstractCRSProvider.SupportedTransformationParameters mapTransformationParameters(CRSCodeType[] codes)
           
protected abstract  CoordinateSystem parseCoordinateSystem(T crsDefinition)
           
abstract  Transformation parseTransformation(T transformationDefinition)
           
protected  void setResolver(CRSResource<T> newResolver)
          Set the resolver to the given resolver.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.crs.configuration.CRSProvider
canExport, export, getAvailableCRSCodes, getAvailableCRSs, getIdentifiable, getTransformation
 

Constructor Detail

AbstractCRSProvider

public AbstractCRSProvider(Properties properties,
                           Class<K> subType,
                           CRSResource<T> defaultResolver)
Type Parameters:
K -
Parameters:
properties -
subType -
defaultResolver -
Method Detail

getCRSByCode

public CoordinateSystem getCRSByCode(CRSCodeType id)
                              throws CRSConfigurationException
Retrieves the CoordinateSystem from the set provider that is identified by the given CRSCodeType id.

Specified by:
getCRSByCode in interface CRSProvider
Parameters:
id - the CRSCodeType of the wanted crs
Returns:
the CoordinateSystem that corresponds to the id
Throws:
CRSConfigurationException

setResolver

protected void setResolver(CRSResource<T> newResolver)
Set the resolver to the given resolver.

Parameters:
newResolver -

getResolver

protected CRSResource<T> getResolver()
Returns:
the resolver for a type.

parseCoordinateSystem

protected abstract CoordinateSystem parseCoordinateSystem(T crsDefinition)
                                                   throws CRSConfigurationException
Parameters:
crsDefinition - containing the definition of a crs in the understood type.
Returns:
a CoordinateSystem instance initialized with values from the given type definition fragment or null if the given crsDefinition is null or not known.
Throws:
CRSConfigurationException - if an error was found in the given crsDefintion

parseTransformation

public abstract Transformation parseTransformation(T transformationDefinition)
                                            throws CRSConfigurationException
Parameters:
transformationDefinition - containing the parameters needed to build a Transformation.
Returns:
a Transformation instance initialized with values from the given definition or null if the given transformationDefintion is null. If the parsed transformation is not supported or a NotSupportedTransformation will be returned.
Throws:
CRSConfigurationException - if an error was found in the given crsDefintion

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(Class<V> expectedType,
                                                           CRSIdentifiable ids)
The id are what they are, not trimming 'upcasing' or other modifications will be done in this method.

Type Parameters:
V - the type to cast to if the casting fails, null will be returned.
Parameters:
expectedType - The class of type T which is expected.
ids - to search the cache for
Returns:
the CRSIdentifiable of the first matching id or null if it was not found.

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(Class<V> expectedType,
                                                           String[] ids)
The id are what they are, not trimming 'upcasing' or other modifications will be done in this method.

Type Parameters:
V - the type to cast to if the casting fails, null will be returned.
Parameters:
expectedType - The class of type T which is expected.
ids - to search the cache for
Returns:
the CRSIdentifiable of the first matching id or null if it was not found.

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(Class<V> expectedType,
                                                           CRSCodeType[] ids)
Get a CRSIdentifiable (actually a type V that extends it) from the cache that corresponds to the a CRSCodeType. An array of code types is given; the first identifiable that is found in (for a code, when they are checked in order) is returned

Type Parameters:
V -
Parameters:
expectedType - the type of the sought object
ids - an array of CRSCodeTypes
Returns:
the identifiable found in the cache corresponding to the (first) id

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(Class<V> expectedType,
                                                           String id)
The id is as it is, not trimming 'upcasing' or other modifications will be done in this method.

Type Parameters:
V - the type to cast to if the casting fails, null will be returned.
Parameters:
expectedType - The class of type T which is expected.
id - to search the cache for
Returns:
the CRSIdentifiable or null if it was not found or the wrong type was found.

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(Class<V> expectedType,
                                                           CRSCodeType id)
Get a CRSIdentifiable (actually a type V that extends it) from the cache that corresponds to the a CRSCodeType.

Type Parameters:
V -
Parameters:
expectedType - the type of the sought object
id - a CRSCodeType
Returns:
the identifiable found in the cache corresponding to the id

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(String id)
The id is as it is, not trimming 'upcasing' or other modifications will be done in this method.

Type Parameters:
V - the type to cast to if the casting fails, null will be returned.
Parameters:
id - to search the cache for
Returns:
the CRSIdentifiable or null if it was not found or the wrong type was found.

getCachedIdentifiable

public <V extends CRSIdentifiable> V getCachedIdentifiable(CRSCodeType id)
Get a CRSIdentifiable (actually a type V that extends it) from the cache that corresponds to the a CRSCodeType.

Type Parameters:
V -
Parameters:
id - a CRSCodeType
Returns:
a CRSIdentifiable-extending object that corresponds to the given id

addIdToCache

public <V extends CRSIdentifiable> V addIdToCache(V identifiable,
                                                  boolean update)
Add the id to the cache, by mapping it to all its identifiers.

Type Parameters:
V - type of CRSIdentifiable
Parameters:
identifiable - to insert into cache
update - if true an existing identifiable in the cache will be overwritten.
Returns:
the identifiable

mapProjections

protected AbstractCRSProvider.SupportedProjections mapProjections(CRSCodeType[] codes)
Parameters:
codes - to check for.
Returns:
a mapped projection or AbstractCRSProvider.SupportedProjections.NOT_SUPPORTED, never null

mapProjectionParameters

protected AbstractCRSProvider.SupportedProjectionParameters mapProjectionParameters(CRSCodeType[] codes)
Parameters:
codes - to check for.
Returns:
a mapped projections parameters or AbstractCRSProvider.SupportedProjectionParameters.NOT_SUPPORTED, never null

mapTransformation

protected AbstractCRSProvider.SupportedTransformations mapTransformation(CRSCodeType[] codes)
Parameters:
codes - to check for.
Returns:
a mapped transformation or AbstractCRSProvider.SupportedTransformations.NOT_SUPPORTED, never null

mapTransformationParameters

protected AbstractCRSProvider.SupportedTransformationParameters mapTransformationParameters(CRSCodeType[] codes)
Parameters:
codes - to check for.
Returns:
a mapped transformation or AbstractCRSProvider.SupportedTransformations.NOT_SUPPORTED, never null

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>