Class AnnotationFactory

java.lang.Object
org.apache.uima.fit.factory.AnnotationFactory

public final class AnnotationFactory extends Object
Convenience methods to create annotations
  • Method Details

    • createAnnotation

      public static <T extends org.apache.uima.jcas.tcas.Annotation> T createAnnotation(org.apache.uima.jcas.JCas jCas, int begin, int end, Class<T> cls)
      Provides a convenient way to create an annotation and addToIndexes in a single line.
      Type Parameters:
      T - the annotation type
      Parameters:
      jCas - the JCas to create the annotation in
      begin - the begin offset
      end - the end offset
      cls - the annotation class as generated by JCasGen
      Returns:
      the new annotation