Class AnalysisComponentAdapterFactory


  • public class AnalysisComponentAdapterFactory
    extends java.lang.Object
    Factory that builds AnalysisComponent instances from AnalysisEngineDescription, CasConsumerDescription, or CollectionReaderDescription objects.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String LOG_RESOURCE_BUNDLE
      resource bundle for log messages
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static AnalysisComponent createAdapter​(java.lang.Object aAdaptee, AnalysisEngineMetaData aMetaData, java.util.Map<java.lang.String,​java.lang.Object> aAdditionalParams)
      Creates an adapter that allows the given object to implement the AnalysisComponent interface.
      static boolean isAdaptable​(java.lang.Class<?> cls)
      Determines whether this factory is capable of producing an adapter that adapts the given class to the AnalysisComponent interface.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG_RESOURCE_BUNDLE

        protected static final java.lang.String LOG_RESOURCE_BUNDLE
        resource bundle for log messages
        See Also:
        Constant Field Values
    • Constructor Detail

      • AnalysisComponentAdapterFactory

        public AnalysisComponentAdapterFactory()
    • Method Detail

      • createAdapter

        public static AnalysisComponent createAdapter​(java.lang.Object aAdaptee,
                                                      AnalysisEngineMetaData aMetaData,
                                                      java.util.Map<java.lang.String,​java.lang.Object> aAdditionalParams)
                                               throws ResourceInitializationException
        Creates an adapter that allows the given object to implement the AnalysisComponent 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 interface
        aMetaData - metadata for the AnalysisEngine containing this component
        aAdditionalParams - parameters passed to AE's initialize method
        Returns:
        an object that wraps aAdaptee and implements the AnalysisComponent interface.
        Throws:
        ResourceInitializationException - if passed an adaptee which is not an analysis component
      • isAdaptable

        public static boolean isAdaptable​(java.lang.Class<?> cls)
        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 to AnalysisComponent.