PipeBitLocator - apache/ctakes GitHub Wiki

@SuppressWarnings( "unchecked" ) public enum PipeBitLocator

Utility methods to find annotation engines and collection readers without and package specified.

  • Author: SPF , chip-nlp
  • Version: %I%
  • Since: 11/18/2017

public Collection<String> getUserPackages()

  • Returns: user package or directory

public void addUserPackage( final String packagePath )

Add some user package or directory to the known path

  • Parameters:
    • packagePath user package or directory

public Class<? extends AnalysisComponent> getComponentClass( final String className ) throws ResourceInitializationException

  • Parameters:
    • className fully-specified or simple name of an ae or cc component class
  • Returns: discovered class for ae or cc
  • Exceptions:
    • ResourceInitializationException if the class could not be found

private Class<? extends AnalysisComponent> getPackagedComponent( final String className )

  • Parameters:
    • className fully-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:
    • className fully-specified or simple name of a cr Collection Reader class
  • Returns: a class for the reader
  • Exceptions:
    • ResourceInitializationException if the class could not be found or instantiated

private Class<? extends CollectionReader> getPackagedReader( final String className )

  • Parameters:
    • className simple 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:
    • packageName possible package for class
    • className simple name for class
    • wantedClassType desired 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:

    • className component class for which a descriptor should be created
    • values optional parameter values for the descriptor creator
  • Returns: a description generated for the component

  • Exceptions:

    • ResourceInitializationException if anything went wrong with finding the class or the method,

    or invoking the method to get an AnalysisEngineDescription

static private Class<?>[] getValueTypes( final Object... values )

The java reflection getMethod does not handle autoboxing/unboxing. So, we assume that Integer and Boolean parameter values will actually be primitives.

  • Parameters:
    • values parameter 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:
    • classType class type to test
    • wantedClassType wanted class type
  • Exceptions:
    • ResourceInitializationException if the class type does not extend the wanted class type

static private boolean isClassType( final Class<?> classType, final Class<?> wantedClassType )

  • Parameters:
    • classType class type to test
    • wantedClassType wanted class type
  • Returns: true if the class type extends the wanted class type
⚠️ **GitHub.com Fallback** ⚠️