org.apache.uima.jcas

## Class JCasRegistry

- java.lang.Object
- - org.apache.uima.jcas.JCasRegistry

-     public class JCasRegistry
      extends Object

  Maintains a registry of JCas cover classes that have been loaded. Methods on this class are called from JCas cover classes (that is, classes generated by JCasGen). They are not intended to be called directly from user-written code.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JCasRegistry()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Class<? extends TOP>` | `getClassForIndex(int aIndex)` Gets the JCas cover class for a given index.
    `static boolean` | `getFeatOkTst(String fullyQualTypeName)` For a particular type, return true if that type should have run-time checking for use of fields defined in the JCas Model which are not present in the CAS.
    `static int` | `getNumberOfRegisteredClasses()` Gets the number of cover classes that have been registered.
    `static int` | `register(Class<? extends TOP> aJCasCoverClass)` Registers a JCas cover class with this registry.

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

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

- - ### Constructor Detail

    - #### JCasRegistry

          public JCasRegistry()

  - ### Method Detail

    - #### register

          public static int register(Class<? extends TOP> aJCasCoverClass)

      Registers a JCas cover class with this registry. The registry will assign it a unique index, which is then used by the cover-class to identify itself to the JCas implementation.
      Parameters:
        `aJCasCoverClass` - the class to register
      Returns:
        the unique index value for this class.

    - #### getFeatOkTst

          public static boolean getFeatOkTst(String fullyQualTypeName)

      For a particular type, return true if that type should have run-time checking for use of fields defined in the JCas Model which are not present in the CAS. If false, all fields in the JCas must be in the CAS type system at instantiation time, or an exception is thrown; this allows the runtime to skip this test.

      This is reserved for future use; it currently always returns true.

      Parameters:
        `fullyQualTypeName` - fully qualified type name
      Returns:
        true if that type should have run-time checking for use of fields defined in the JCas Model which are not present in the CAS. If false, all fields in the JCas must be in the CAS type system at instantiation time, or an exception is thrown; this allows the runtime to skip this test.

    - #### getNumberOfRegisteredClasses

          public static int getNumberOfRegisteredClasses()

      Gets the number of cover classes that have been registered.
      Returns:
        the number of registered JCas cover classes

    - #### getClassForIndex

          public static Class<? extends TOP> getClassForIndex(int aIndex)

      Gets the JCas cover class for a given index.
      Parameters:
        `aIndex` - the index
      Returns:
        the JCas cover class that was assigned the value `aIndex` during its registration, `null` if none.

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