Package opennlp.tools.util.ext
Class ExtensionLoader
java.lang.Object
opennlp.tools.util.ext.ExtensionLoader
The
ExtensionLoader is responsible to load extensions to the OpenNLP library.
Note: Do not use this class, internal use only!
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TinstantiateExtension(Class<T> clazz, String extensionClassName) Instantiates an user provided extension to OpenNLP.
-
Method Details
-
instantiateExtension
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
INSTANCEthat returns an object of the typeT.- Parameters:
clazz-extensionClassName-- Returns:
- the instance of the extension class
-