Package org.apache.uima.impl
Class CompositeResourceFactory_impl
java.lang.Object
org.apache.uima.impl.CompositeResourceFactory_impl
- All Implemented Interfaces:
CompositeResourceFactory,ResourceFactory
A registry containing (ResourceSpecifier Class,
ResourceFactory) pairs. Also implements
the ResourceFactory interface, and produces resources by delegating to the most
recently registered ResourceFactory instance that can handle the class of the given
specifier object.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionproduceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) Produces an appropriateResourceinstance from aResourceSpecifier.voidregisterFactory(Class aResourceSpecifierInterface, ResourceFactory aFactory) Registers a ResourceFactory with this composite factory.
-
Constructor Details
-
CompositeResourceFactory_impl
public CompositeResourceFactory_impl()
-
-
Method Details
-
produceResource
public Resource produceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionDescription copied from interface:ResourceFactoryProduces an appropriateResourceinstance from aResourceSpecifier. This version ofproduceResourcetakes a Map containing additional parameters to be passed to theResource.initialize(ResourceSpecifier,Map)method.- Specified by:
produceResourcein interfaceResourceFactory- Parameters:
aResourceClass- the class of resource to be produced (NOTE: this is intended to be a standard UIMA interface name such as "TextAnalysisEngine" or "ASB")aSpecifier- an object that specifies how to acquire an instance of aResource.aAdditionalParams- a Map containing additional parameters to pass to theResource.initialize(ResourceSpecifier,Map)method. May benullif there are no parameters.- Returns:
- a
Resourceinstance. Returnsnullif this factory does not know how to create a Resource from theResourceSpecifierprovided. - Throws:
ResourceInitializationException- if a failure occurred during production of the resource- See Also:
-
registerFactory
Description copied from interface:CompositeResourceFactoryRegisters a ResourceFactory with this composite factory.- Specified by:
registerFactoryin interfaceCompositeResourceFactory- Parameters:
aResourceSpecifierInterface- the subinterface ofResourceSpecifierthat the factory can handleaFactory- the factory used to create resources from resource specifiers of the given type- See Also:
-