|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.imageio.spi.ServiceRegistry
org.geotools.factory.FactoryRegistry
org.geotools.factory.FactoryCreator
public class FactoryCreator
A factory registry capable to creates factories if no appropriate instance was found in the registry.
This class maintains a cache of previously created factories, as weak references. Calls to getServiceProvider
first check if a
previously created factory can fit.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.imageio.spi.ServiceRegistry |
---|
javax.imageio.spi.ServiceRegistry.Filter |
Field Summary |
---|
Fields inherited from class org.geotools.factory.FactoryRegistry |
---|
LOGGER |
Constructor Summary | |
---|---|
FactoryCreator(java.lang.Class<?> category)
Constructs a new registry for the specified category. |
|
FactoryCreator(java.lang.Class<?>[] categories)
Constructs a new registry for the specified categories. |
|
FactoryCreator(java.util.Collection<java.lang.Class<?>> categories)
Constructs a new registry for the specified categories. |
Method Summary | ||
---|---|---|
protected
|
createServiceProvider(java.lang.Class<T> category,
java.lang.Class<?> implementation,
Hints hints)
Creates a new instance of the specified factory using the specified hints. |
|
|
getServiceProvider(java.lang.Class<T> category,
javax.imageio.spi.ServiceRegistry.Filter filter,
Hints hints,
Hints.Key key)
Returns a provider for the specified category, using the specified map of hints (if any). |
Methods inherited from class org.geotools.factory.FactoryRegistry |
---|
getClassLoaders, getServiceProviders, isAcceptable, scanForPlugins, setOrdering, setOrdering |
Methods inherited from class javax.imageio.spi.ServiceRegistry |
---|
contains, deregisterAll, deregisterAll, deregisterServiceProvider, deregisterServiceProvider, finalize, getCategories, getServiceProviderByClass, getServiceProviders, getServiceProviders, lookupProviders, lookupProviders, registerServiceProvider, registerServiceProvider, registerServiceProviders, setOrdering, unsetOrdering |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FactoryCreator(java.lang.Class<?> category)
category
- The single category.public FactoryCreator(java.lang.Class<?>[] categories)
categories
- The categories.public FactoryCreator(java.util.Collection<java.lang.Class<?>> categories)
categories
- The categories.Method Detail |
---|
public <T> T getServiceProvider(java.lang.Class<T> category, javax.imageio.spi.ServiceRegistry.Filter filter, Hints hints, Hints.Key key) throws FactoryRegistryException
getServiceProvider
in class FactoryRegistry
T
- The class represented by the category
argument.category
- The category to look for.filter
- An optional filter, or null
if none.hints
- A map of hints, or null
if none.key
- The key to use for looking for a user-provided instance in the hints, or
null
if none.
null
).
FactoryNotFoundException
- if no factory was found, and the specified hints don't
provide suffisient information for creating a new factory.
FactoryRegistryException
- if the factory can't be created for some other reason.#getServiceProviders(Class, Filter, Hints)
,
getServiceProvider(java.lang.Class, javax.imageio.spi.ServiceRegistry.Filter, org.geotools.factory.Hints, org.geotools.factory.Hints.Key)
protected <T> T createServiceProvider(java.lang.Class<T> category, java.lang.Class<?> implementation, Hints hints) throws FactoryRegistryException
Hints
argument.
category
- The category to instantiate.implementation
- The factory class to instantiate.hints
- The implementation hints.
FactoryRegistryException
- if the factory creation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |