org.apache.uima.cas.impl

## Class TypeSystemUtils

- java.lang.Object
- - org.apache.uima.cas.impl.TypeSystemUtils

-     public abstract class TypeSystemUtils
      extends Object

  Type Utilities - all static, so class is abstract to prevent creation Used by Feature Path

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TypeSystemUtils.PathValid`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeSystemUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `classifyType(Type type)` Classify types into FS type, array type etc.
    `static boolean` | `isIdentifier(String s)`
    `static TypeSystemUtils.PathValid` | `isPathValid(Type type, List<String> path)` Given a starting Type and a list of features representing a feature path, checks if a feature path is valid for a given type.

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

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

- - ### Constructor Detail

    - #### TypeSystemUtils

          public TypeSystemUtils()

  - ### Method Detail

    - #### isIdentifier

          public static boolean isIdentifier(String s)

    - #### isPathValid

          public static final TypeSystemUtils.PathValid isPathValid(Type type,
                                                                    List<String> path)

      Given a starting Type and a list of features representing a feature path, checks if a feature path is valid for a given type.

      We distinguish three cases:

      1. `PathValid.NEVER`: there is no object of `type` on which `path` can ever be defined.
      2. `PathValid.ALWAYS`: if all intermediate objects are non-null, this `path` will always be defined on any object of `type`.
      3. `PathValid.POSSIBLE`: some objects of `type` will have `path` defined, while others may not.
      Note: In computing validity, we always assume that all references are not null. A return value of ALWAYS can of course not guarantee that all intermediate objects will always exist; only that if they exist, the path will be defined.
      Parameters:
        `type` - The type.
        `path` - The path to check.
      Returns:
        One of `ALWAYS`, `POSSIBLE`, or `NEVER`.

    - #### classifyType

          public static final int classifyType(Type type)

      Classify types into FS type, array type etc. For the full list of return types, see the `LowLevelCAS.TYPE_CLASS*` constants, as well as the documentation for `LowLevelCAS.ll_getTypeClass(int)`.
      Parameters:
        `type` - The type to classify.
      Returns:
        An integer encoding the the type class. See above.

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