org.geotools.factory
Class CommonFactoryFinder

java.lang.Object
  extended by org.geotools.factory.FactoryFinder
      extended by org.geotools.factory.CommonFactoryFinder

public final class CommonFactoryFinder
extends FactoryFinder

Defines static methods used to access the application's default implementation for some common factories. Those "common" factories comprise the style and filter factories. Note that some specialized factories finder like referencing and coverage are defined in specialized classes.

Tip: The BasicFactories classes provides an other way to access the various factories from a central point.

Since:
2.4
Version:
$Id: CommonFactoryFinder.java 35586 2010-05-25 14:06:26Z aaime $
Author:
Martin Desruisseaux, Jody Garnett

Field Summary
 
Fields inherited from class org.geotools.factory.FactoryFinder
EMPTY_HINTS
 
Method Summary
static FeatureCollections getFeatureCollections(Hints hints)
          Returns the first implementation of FeatureCollections matching the specified hints.
static java.util.Set getFeatureCollectionsSet(Hints hints)
          Returns a set of all available implementations for the FeatureCollections interface.
static org.opengis.feature.FeatureFactory getFeatureFactory(Hints hints)
          Return the first implementation of FeatureFactory matching the specified hints.
static java.util.Set getFeatureLockFactories(Hints hints)
          Returns a set of all available implementations for the FeatureLockFactory interface.
static FeatureLockFactory getFeatureLockFactory(Hints hints)
          Returns the first implementation of FeatureLockFactory matching the specified hints.
static org.opengis.feature.type.FeatureTypeFactory getFeatureTypeFactory(Hints hints)
          Return the first implementation of FeatureTypeFactory matching the specified hints.
static java.util.Set getFileDataStoreFactories(Hints hints)
          Returns a set of all available implementations for the FileDataStoreFactorySpi interface.
static java.util.Set getFilterFactories(Hints hints)
          Returns a set of all available implementations for the FilterFactory interface.
static org.opengis.filter.FilterFactory getFilterFactory(Hints hints)
          Returns the first implementation of FilterFactory matching the specified hints.
static org.opengis.filter.FilterFactory2 getFilterFactory2(Hints hints)
          Returns the first implementation of FilterFactory2 matching the specified hints.
static java.util.Set getFunctionExpressions(Hints hints)
          Deprecated. Use FunctionExpression is now @deprecated
static java.util.Set getFunctions(Hints hints)
          Returns a set of all available implementations for the Function interface.
static java.util.Set getStyleFactories(Hints hints)
          Returns a set of all available implementations for the StyleFactory interface.
static StyleFactory getStyleFactory(Hints hints)
          Returns the first implementation of StyleFactory matching the specified hints.
static void reset()
          Resets the factory finder and prepares for a new full scan of the SPI subsystems
static void scanForPlugins()
          Scans for factory plug-ins on the application class path.
 
Methods inherited from class org.geotools.factory.FactoryFinder
mergeSystemHints
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getStyleFactory

public static StyleFactory getStyleFactory(Hints hints)
                                    throws FactoryRegistryException
Returns the first implementation of StyleFactory matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
The first style factory that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the StyleFactory interface.
See Also:
Hints.STYLE_FACTORY

getStyleFactories

public static java.util.Set getStyleFactories(Hints hints)
Returns a set of all available implementations for the StyleFactory interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available style factory implementations.

getFunctionExpressions

public static java.util.Set getFunctionExpressions(Hints hints)
Deprecated. Use FunctionExpression is now @deprecated

Returns a set of all available implementations for the FunctionExpression interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available style factory implementations.

getFunctions

public static java.util.Set getFunctions(Hints hints)
Returns a set of all available implementations for the Function interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available function expression implementations.

getFeatureLockFactory

public static FeatureLockFactory getFeatureLockFactory(Hints hints)
Returns the first implementation of FeatureLockFactory matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
The first feature lock factory that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the FeatureLockFactory interface.
See Also:
Hints.FEATURE_LOCK_FACTORY

getFeatureLockFactories

public static java.util.Set getFeatureLockFactories(Hints hints)
Returns a set of all available implementations for the FeatureLockFactory interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available style factory implementations.

getFileDataStoreFactories

public static java.util.Set getFileDataStoreFactories(Hints hints)
Returns a set of all available implementations for the FileDataStoreFactorySpi interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available file data store factory implementations.

getFeatureFactory

public static org.opengis.feature.FeatureFactory getFeatureFactory(Hints hints)
Return the first implementation of FeatureFactory matching the specified hints.

If no implementation matches, a new one is created if possible or an exception is thrown.

Parameters:
hints - An optional map of hints; or null if none
Returns:
Instance of FeatureFactory matching the supplied hints
Throws:
FactoryRegistryException - if no implementation could be provided
See Also:
Hints.FEATURE_FACTORY

getFeatureTypeFactory

public static org.opengis.feature.type.FeatureTypeFactory getFeatureTypeFactory(Hints hints)
Return the first implementation of FeatureTypeFactory matching the specified hints.

If no implementation matches, a new one is created if possible or an exception is thrown.

Parameters:
hints - An optional map of hints; or null if none
Returns:
Instance of FeatureTypeFactory matching the supplied hints
Throws:
FactoryRegistryException - if no implementation could be provided
See Also:
Hints.FEATURE_TYPE_FACTORY

getFeatureCollections

public static FeatureCollections getFeatureCollections(Hints hints)
Returns the first implementation of FeatureCollections matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
The first feature collections that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the FeatureCollections interface.
See Also:
Hints.FEATURE_COLLECTIONS

getFeatureCollectionsSet

public static java.util.Set getFeatureCollectionsSet(Hints hints)
Returns a set of all available implementations for the FeatureCollections interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available feature collections implementations.

getFilterFactory

public static org.opengis.filter.FilterFactory getFilterFactory(Hints hints)
                                                         throws FactoryRegistryException
Returns the first implementation of FilterFactory matching the specified hints. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
The first filter factory that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the FilterFactory interface.
See Also:
Hints.FILTER_FACTORY

getFilterFactories

public static java.util.Set getFilterFactories(Hints hints)
Returns a set of all available implementations for the FilterFactory interface.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
Set of available filter factory implementations.

getFilterFactory2

public static org.opengis.filter.FilterFactory2 getFilterFactory2(Hints hints)
                                                           throws FactoryRegistryException
Returns the first implementation of FilterFactory2 matching the specified hints. This is a convenience method invoking getFilterFactory(org.geotools.factory.Hints) with a hint value set for requerying a FactoryFilter2 implementation.

Parameters:
hints - An optional map of hints, or null if none.
Returns:
The first filter factory that matches the supplied hints.
Throws:
FactoryRegistryException - if no implementation was found or can be created for the FilterFactory2 interface.
See Also:
Hints.FILTER_FACTORY

scanForPlugins

public static void scanForPlugins()
Scans for factory plug-ins on the application class path. This method is needed because the application class path can theoretically change, or additional plug-ins may become available. Rather than re-scanning the classpath on every invocation of the API, the class path is scanned automatically only on the first invocation. Clients can call this method to prompt a re-scan. Thus this method need only be invoked by sophisticated applications which dynamically make new plug-ins available at runtime.


reset

public static void reset()
Resets the factory finder and prepares for a new full scan of the SPI subsystems



Copyright © 1996-2010 Geotools. All Rights Reserved.