Class CommonFactoryFinder

Object
FactoryFinder
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 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
  • Method Details

    • 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:
    • getStyleFactory

      public static StyleFactory getStyleFactory() throws FactoryRegistryException
      Returns the first implementation of StyleFactory. 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 the StyleFactory interface.
      See Also:
    • getStyleFactories

      public static Set<StyleFactory> 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.
    • getFunctions

      public static Set<Function> 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.
    • getFunctionFactories

      public static Set<FunctionFactory> getFunctionFactories(Hints hints)
      Returns a set of all available implementations of FunctionFactory.
      Parameters:
      hints - An optional map of hints, or null if none.
      Returns:
      Set of available function factory implementations.
    • getFileDataStoreFactories

      public static Set<FileDataStoreFactorySpi> 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 FeatureFactory getFeatureFactory(Hints hints)
      Return an implementation of FeatureFactory matching the specified hint FEATURE_FACTORY.

      If no hint is specified, LenientFeatureFactoryImpl will be used.

      Uses lookup functionality to get an instance of the factory.

      Parameters:
      hints - An optional map of hints; or null if none
      Returns:
      Instance of FeatureFactory
      Throws:
      FactoryRegistryException - if no implementation could be provided
      See Also:
    • getFeatureTypeFactory

      public static 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:
    • getFilterFactory

      public static 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:
    • getFilterFactory

      public static FilterFactory getFilterFactory() throws FactoryRegistryException
      Returns the first implementation of FilterFactory. 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 the FilterFactory interface.
      See Also:
    • getFilterFactories

      public static Set<FilterFactory> 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.
    • 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