Class ExtensionLoader


  • public class ExtensionLoader
    extends java.lang.Object
    The ExtensionLoader is responsible to load extensions to the OpenNLP library.

    Note: Do not use this class, internal use only!

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T instantiateExtension​(java.lang.Class<T> clazz, java.lang.String extensionClassName)
      Instantiates an user provided extension to OpenNLP.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • instantiateExtension

        public static <T> T instantiateExtension​(java.lang.Class<T> clazz,
                                                 java.lang.String extensionClassName)
        Instantiates an user provided extension to OpenNLP.

        The extension is either loaded from the class path or if running inside an OSGi environment via an OSGi service.

        Initially it tries using the public default constructor. If it is not found, it will check if the class follows the singleton pattern: a static field named INSTANCE that returns an object of the type T.

        Parameters:
        clazz -
        extensionClassName -
        Returns:
        the instance of the extension class