Package org.geotools.factory
Class CommonFactoryFinder
Object
FactoryFinder
CommonFactoryFinder
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 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
- Author:
- Martin Desruisseaux, Jody Garnett
-
Field Summary
Fields inherited from class FactoryFinder
EMPTY_HINTS -
Method Summary
Modifier and TypeMethodDescriptionstatic FeatureFactorygetFeatureFactory(Hints hints) Return an implementation ofFeatureFactorymatching the specified hint FEATURE_FACTORY.static FeatureTypeFactorygetFeatureTypeFactory(Hints hints) Return the first implementation ofFeatureTypeFactorymatching the specified hints.static Set<FileDataStoreFactorySpi>getFileDataStoreFactories(Hints hints) Returns a set of all available implementations for theFileDataStoreFactorySpiinterface.static Set<FilterFactory>getFilterFactories(Hints hints) Returns a set of all available implementations for theFilterFactoryinterface.static FilterFactoryReturns the first implementation ofFilterFactory.static FilterFactorygetFilterFactory(Hints hints) Returns the first implementation ofFilterFactorymatching the specified hints.static Set<FunctionFactory>getFunctionFactories(Hints hints) Returns a set of all available implementations ofFunctionFactory.getFunctions(Hints hints) Returns a set of all available implementations for theFunctioninterface.static Set<StyleFactory>getStyleFactories(Hints hints) Returns a set of all available implementations for theStyleFactoryinterface.static StyleFactoryReturns the first implementation ofStyleFactory.static StyleFactorygetStyleFactory(Hints hints) Returns the first implementation ofStyleFactorymatching the specified hints.static voidreset()Resets the factory finder and prepares for a new full scan of the SPI subsystemsstatic voidScans for factory plug-ins on the application class path.Methods inherited from class FactoryFinder
mergeSystemHints
-
Method Details
-
getStyleFactory
Returns the first implementation ofStyleFactorymatching 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, ornullif none.- Returns:
- The first style factory that matches the supplied hints.
- Throws:
FactoryRegistryException- if no implementation was found or can be created for theStyleFactoryinterface.- See Also:
-
getStyleFactory
Returns the first implementation ofStyleFactory. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.- Returns:
- The first style factory available
- Throws:
FactoryRegistryException- if no implementation was found or can be created for theStyleFactoryinterface.- See Also:
-
getStyleFactories
Returns a set of all available implementations for theStyleFactoryinterface.- Parameters:
hints- An optional map of hints, ornullif none.- Returns:
- Set of available style factory implementations.
-
getFunctions
Returns a set of all available implementations for theFunctioninterface.- Parameters:
hints- An optional map of hints, ornullif none.- Returns:
- Set of available function expression implementations.
-
getFunctionFactories
Returns a set of all available implementations ofFunctionFactory.- Parameters:
hints- An optional map of hints, ornullif none.- Returns:
- Set of available function factory implementations.
-
getFileDataStoreFactories
Returns a set of all available implementations for theFileDataStoreFactorySpiinterface.- Parameters:
hints- An optional map of hints, ornullif none.- Returns:
- Set of available file data store factory implementations.
-
getFeatureFactory
Return an implementation ofFeatureFactorymatching the specified hint FEATURE_FACTORY.If no hint is specified,
LenientFeatureFactoryImplwill be used.Uses lookup functionality to get an instance of the factory.
- Parameters:
hints- An optional map of hints; ornullif none- Returns:
- Instance of FeatureFactory
- Throws:
FactoryRegistryException- if no implementation could be provided- See Also:
-
getFeatureTypeFactory
Return the first implementation ofFeatureTypeFactorymatching 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; ornullif none- Returns:
- Instance of FeatureTypeFactory matching the supplied hints
- Throws:
FactoryRegistryException- if no implementation could be provided- See Also:
-
getFilterFactory
Returns the first implementation ofFilterFactorymatching 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, ornullif none.- Returns:
- The first filter factory that matches the supplied hints.
- Throws:
FactoryRegistryException- if no implementation was found or can be created for theFilterFactoryinterface.- See Also:
-
getFilterFactory
Returns the first implementation ofFilterFactory. If no implementation matches, a new one is created if possible or an exception is thrown otherwise.- Returns:
- The first filter factory implementation
- Throws:
FactoryRegistryException- if no implementation was found or can be created for theFilterFactoryinterface.- See Also:
-
getFilterFactories
Returns a set of all available implementations for theFilterFactoryinterface.- Parameters:
hints- An optional map of hints, ornullif none.- Returns:
- Set of available filter factory implementations.
-
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
-