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
static <T> T
Provides a way to create an instance of T.static <T> Class<? extends T>
static void
initialize
(Object object, org.apache.uima.UimaContext context)
-
Method Details
-
create
public static <T> T create(org.apache.uima.UimaContext context, String className, Class<T> superClass) throws org.apache.uima.resource.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:
org.apache.uima.resource.ResourceInitializationException
- if there was a problem during initialization or instantiation
-
getClass
public static <T> Class<? extends T> getClass(String className, Class<T> superClass) throws org.apache.uima.resource.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:
org.apache.uima.resource.ResourceInitializationException
- if there was a problem casting the class
-
create
public static <T> T create(org.apache.uima.UimaContext context, Class<? extends T> cls) throws org.apache.uima.resource.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:
org.apache.uima.resource.ResourceInitializationException
- if there was a problem during initialization or instantiation
-
initialize
public static void initialize(Object object, org.apache.uima.UimaContext context) throws org.apache.uima.resource.ResourceInitializationException - Parameters:
object
- an instance of a class implementingInitializable
context
- the UIMA context containing the parameter settings- Throws:
org.apache.uima.resource.ResourceInitializationException
- if there was a problem during initialization
-