Class InitializableFactory
java.lang.Object
org.apache.uima.fit.factory.initializable.InitializableFactory
Please see
Initializable
for a description of how this class is intended to be used.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
create
(UimaContext context, Class<? extends T> cls) static <T> T
create
(UimaContext context, String className, Class<T> superClass) Provides a way to create an instance of T.static <T> Class
<? extends T> static void
initialize
(Object object, UimaContext context)
-
Method Details
-
create
public static <T> T create(UimaContext context, String className, Class<T> superClass) throws ResourceInitializationException Provides a way to create an instance of T. If the class specified by className implementsInitializable
, then the UimaContext provided here will be passed to its initialize method.- Type Parameters:
T
- the interface type- Parameters:
context
- the UIMA context containing the parameter settingsclassName
- the name of a class implementingInitializable
superClass
- a class to which the initializable class is cast- Returns:
- a new initialized instance of the initializable class cast as the specified class
- Throws:
ResourceInitializationException
- if there was a problem during initialization or instantiation
-
getClass
public static <T> Class<? extends T> getClass(String className, Class<T> superClass) throws ResourceInitializationException - Type Parameters:
T
- the interface type- Parameters:
className
- the name of a class implementingInitializable
superClass
- a class to which the initializable class is cast- Returns:
- a new initialized instance of the initializable class cast as the specified class
- Throws:
ResourceInitializationException
- if there was a problem casting the class
-
create
public static <T> T create(UimaContext context, Class<? extends T> cls) throws ResourceInitializationException - Type Parameters:
T
- the interface type- Parameters:
context
- the UIMA context containing the parameter settingscls
- the class implementingInitializable
- Returns:
- a new initialized instance of the initializable class cast as the specified class
- Throws:
ResourceInitializationException
- if there was a problem during initialization or instantiation
-
initialize
public static void initialize(Object object, UimaContext context) throws ResourceInitializationException - Parameters:
object
- an instance of a class implementingInitializable
context
- the UIMA context containing the parameter settings- Throws:
ResourceInitializationException
- if there was a problem during initialization
-