org.apache.uima.fit.factory

## Class AnnotationFactory

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

-     public final class AnnotationFactory
      extends Object

  Convenience methods to create annotations

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static <T extends Annotation> T` | `createAnnotation(JCas jCas, int begin, int end, Class<T> cls)` Provides a convenient way to create an annotation and addToIndexes in a single line.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### createAnnotation

          public static <T extends Annotation> T createAnnotation(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

Copyright © 2012–2021 The Apache Software Foundation. All rights reserved.