PipeBitLocator - apache/ctakes GitHub Wiki
Utility methods to find annotation engines and collection readers without and package specified.
- Author: SPF , chip-nlp
- Version: %I%
-
Since: 11/18/2017
-
Returns: user package or directory
Add some user package or directory to the known path
-
Parameters:
-
packagePathuser package or directory
-
public Class<? extends AnalysisComponent> getComponentClass( final String className ) throws ResourceInitializationException
-
Parameters:
-
classNamefully-specified or simple name of an ae or cc component class
-
- Returns: discovered class for ae or cc
-
Exceptions:
-
ResourceInitializationExceptionif the class could not be found
-
-
Parameters:
-
classNamefully-specified or simple name of an ae or cc component class
-
-
Returns: discovered class for ae or cc
public Class<? extends CollectionReader> getReaderClass( final String className ) throws ResourceInitializationException
-
Parameters:
-
classNamefully-specified or simple name of a cr Collection Reader class
-
- Returns: a class for the reader
-
Exceptions:
-
ResourceInitializationExceptionif the class could not be found or instantiated
-
-
Parameters:
-
classNamesimple name of a cr Collection Reader class
-
-
Returns: discovered class for a cr
static private Class<?> getPackagedClass( final String packageName, final String className, final Class<?> wantedClassType )
-
Parameters:
-
packageNamepossible package for class -
classNamesimple name for class -
wantedClassTypedesired superclass type
-
-
Returns: discovered class or null if no proper class was discovered
public AnalysisEngineDescription createDescription( final String className, final Object... values ) throws ResourceInitializationException
This requires that the component class has a static createAnnotatorDescription method with no parameters
-
Parameters:
-
classNamecomponent class for which a descriptor should be created -
valuesoptional parameter values for the descriptor creator
-
-
Returns: a description generated for the component
-
Exceptions:
-
ResourceInitializationExceptionif anything went wrong with finding the class or the method,
or invoking the method to get an AnalysisEngineDescription
-
The java reflection getMethod does not handle autoboxing/unboxing. So, we assume that Integer and Boolean parameter values will actually be primitives.
-
Parameters:
-
valuesparameter value objects
-
-
Returns: parameter value class types, unboxing to primitives where needed
static private void assertClassType( final Class<?> classType, final Class<?> wantedClassType ) throws ResourceInitializationException
-
Parameters:
-
classTypeclass type to test -
wantedClassTypewanted class type
-
-
Exceptions:
-
ResourceInitializationExceptionif the class type does not extend the wanted class type
-
-
Parameters:
-
classTypeclass type to test -
wantedClassTypewanted class type
-
- Returns: true if the class type extends the wanted class type