org.apache.uima

## Class UimaContextHolder

- java.lang.Object
- - org.apache.uima.UimaContextHolder

-     public class UimaContextHolder
      extends Object

  This class holds the UimaContext for the current thread, or a parent thread. The getContext method may be used by any plain Java class invoked by an annotator, The POJO must run in the same thread or a child thread of the annotator. For example a POJO can access the shared External Override Settings with: String paramValue = UimaContextHolder.getContext().getSetting(paramName);

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `UimaContextHolder()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clearContext()` Clears the UimaContext entry for the current thread
    `static UimaContext` | `getContext()` Get the UimaContext for this thread
    `static UimaContext` | `setContext(UimaContext uimaContext)` Sets the UimaContext for the current thread.

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

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

- - ### Constructor Detail

    - #### UimaContextHolder

          public UimaContextHolder()

  - ### Method Detail

    - #### getContext

          public static UimaContext getContext()

      Get the UimaContext for this thread
      Returns:
        the thread-specific UimaContext

    - #### setContext

          public static UimaContext setContext(UimaContext uimaContext)

      Sets the UimaContext for the current thread.

      NOTE - Should be used only by the UIMA Framework.

      Parameters:
        `uimaContext` - - new UimaContext for this thread
      Returns:
        - previous UimaContext for this thread

    - #### clearContext

          public static void clearContext()

      Clears the UimaContext entry for the current thread

      NOTE - Should be used only by the UIMA Framework.

Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.