public class CompositeResourceFactory_impl extends Object implements CompositeResourceFactory
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 and Description |
---|
CompositeResourceFactory_impl() |
Modifier and Type | Method and Description |
---|---|
Resource |
produceResource(Class<? extends Resource> aResourceClass,
ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Produces an appropriate
Resource instance from a ResourceSpecifier . |
void |
registerFactory(Class aResourceSpecifierInterface,
ResourceFactory aFactory)
Registers a ResourceFactory with this composite factory.
|
public Resource produceResource(Class<? extends Resource> aResourceClass, ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
ResourceFactory
Resource
instance from a ResourceSpecifier
.
This version of produceResource
takes a Map containing additional parameters to
be passed to the Resource.initialize(ResourceSpecifier,Map)
method.produceResource
in interface ResourceFactory
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 a Resource
.aAdditionalParams
- a Map containing additional parameters to pass to the
Resource.initialize(ResourceSpecifier,Map)
method. May be null
if there are no parameters.Resource
instance. Returns null
if this factory does
not know how to create a Resource from the ResourceSpecifier
provided.ResourceInitializationException
- if a failure occurred during production of the resourceResourceFactory.produceResource(java.lang.Class,
org.apache.uima.resource.ResourceSpecifier, java.util.Map)
public void registerFactory(Class aResourceSpecifierInterface, ResourceFactory aFactory)
CompositeResourceFactory
registerFactory
in interface CompositeResourceFactory
aResourceSpecifierInterface
- the subinterface of ResourceSpecifier
that the
factory can handleaFactory
- the factory used to create resources from resource specifiers of the given typeCompositeResourceFactory.registerFactory(Class,ResourceFactory)
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.