Class AnalysisComponentAdapterFactory
java.lang.Object
org.apache.uima.analysis_engine.impl.compatibility.AnalysisComponentAdapterFactory
Factory that builds
AnalysisComponent
instances from AnalysisEngineDescription,
CasConsumerDescription, or CollectionReaderDescription objects.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnalysisComponent
createAdapter
(Object aAdaptee, AnalysisEngineMetaData aMetaData, Map<String, Object> aAdditionalParams) Creates an adapter that allows the given object to implement theAnalysisComponent
interface.static boolean
isAdaptable
(Class<?> cls) Determines whether this factory is capable of producing an adapter that adapts the given class to the AnalysisComponent interface.
-
Field Details
-
LOG_RESOURCE_BUNDLE
resource bundle for log messages- See Also:
-
-
Constructor Details
-
AnalysisComponentAdapterFactory
public AnalysisComponentAdapterFactory()
-
-
Method Details
-
createAdapter
public static AnalysisComponent createAdapter(Object aAdaptee, AnalysisEngineMetaData aMetaData, Map<String, Object> aAdditionalParams) throws ResourceInitializationExceptionCreates an adapter that allows the given object to implement theAnalysisComponent
interface. This is needed because UIMA has distinct interfaces that are implemented by different types of components, e.g. Annotator, CAS Consumer, CollectionReader, but the UIMA framework itself simplifies things by interacting with all of them through a single, common AnalysisComponent interface.- Parameters:
aAdaptee
- Object to adapet to the AnalysisComponent interfaceaMetaData
- metadata for the AnalysisEngine containing this componentaAdditionalParams
- parameters passed to AE's initialize method- Returns:
- an object that wraps
aAdaptee
and implements theAnalysisComponent
interface. - Throws:
ResourceInitializationException
- if passed an adaptee which is not an analysis component
-
isAdaptable
Determines whether this factory is capable of producing an adapter that adapts the given class to the AnalysisComponent interface.- Parameters:
cls
- the adaptee class- Returns:
- true if this factory can adapt
cls
toAnalysisComponent
.
-