org.apache.uima.cas.admin

## Class CASAdminException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.apache.uima.cas.admin.CASAdminException

- All Implemented Interfaces:
    Serializable

      public class CASAdminException
      extends RuntimeException

  Exception class for package org.apache.uima.cas.admin. Automatically generated from message catalog.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `BAD_FEATURE_SYNTAX` Invalid feature name "{0}".
    `static int` | `BAD_TYPE_SYNTAX` Invalid type name "{0}".
    `static int` | `DESERIALIZATION_ERROR` Error deserializing type system.
    `static int` | `DUPLICATE_FEATURE` Trying to define feature "{0}" on type "{1}" with range "{2}", but feature has already been defined on (super)type "{3}" with range "{4}".
    `static int` | `FLUSH_DISABLED` Can't flush CAS, flushing is disabled.
    `static int` | `JCAS_ERROR` {0}
    `static int` | `MUST_COMMIT_INDEX_REPOSITORY` Index repository has not been committed; can't create CAS.
    `static int` | `MUST_COMMIT_TYPE_SYSTEM` Type system has not been committed; can't create index repository.
    `static int` | `REPOSITORY_LOCKED` Can't add index to a committed repository.
    `static int` | `TYPE_IS_FEATURE_FINAL` Can't add feature to type "{0}" since it is feature final.
    `static int` | `TYPE_IS_INH_FINAL` Can't derive from type "{0}" since it is inheritance final.
    `static int` | `TYPE_SYSTEM_LOCKED` Type system is committed; can't add types or features.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CASAdminException(int error)` Create a new `CASAdminException`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addArgument(String s)` Add an argument to a `CASAdminException` object.
    `String[]` | `getArguments()` Get the arguments to the exception string.
    `String` | `getBundleShortName()` Get the short name of the message bundle, i.e., the name without the package prefix.
    `int` | `getError()`
    `String` | `getMessage()`
    `String` | `getMessageCode()` Get the string identifier for this exception.
    `String` | `toString()`

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace`

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

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

- - ### Field Detail

    - #### REPOSITORY_LOCKED

          public static final int REPOSITORY_LOCKED

      Can't add index to a committed repository.
      See Also:
        Constant Field Values

    - #### TYPE_SYSTEM_LOCKED

          public static final int TYPE_SYSTEM_LOCKED

      Type system is committed; can't add types or features.
      See Also:
        Constant Field Values

    - #### MUST_COMMIT_TYPE_SYSTEM

          public static final int MUST_COMMIT_TYPE_SYSTEM

      Type system has not been committed; can't create index repository.
      See Also:
        Constant Field Values

    - #### MUST_COMMIT_INDEX_REPOSITORY

          public static final int MUST_COMMIT_INDEX_REPOSITORY

      Index repository has not been committed; can't create CAS.
      See Also:
        Constant Field Values

    - #### BAD_TYPE_SYNTAX

          public static final int BAD_TYPE_SYNTAX

      Invalid type name "{0}". Type names must start with a letter and consist only of letters, digits, or underscores.
      See Also:
        Constant Field Values

    - #### BAD_FEATURE_SYNTAX

          public static final int BAD_FEATURE_SYNTAX

      Invalid feature name "{0}". Feature names must start with a letter and consist only of letters, digits, or underscores.
      See Also:
        Constant Field Values

    - #### TYPE_IS_INH_FINAL

          public static final int TYPE_IS_INH_FINAL

      Can't derive from type "{0}" since it is inheritance final.
      See Also:
        Constant Field Values

    - #### TYPE_IS_FEATURE_FINAL

          public static final int TYPE_IS_FEATURE_FINAL

      Can't add feature to type "{0}" since it is feature final.
      See Also:
        Constant Field Values

    - #### DESERIALIZATION_ERROR

          public static final int DESERIALIZATION_ERROR

      Error deserializing type system.
      See Also:
        Constant Field Values

    - #### FLUSH_DISABLED

          public static final int FLUSH_DISABLED

      Can't flush CAS, flushing is disabled.
      See Also:
        Constant Field Values

    - #### JCAS_ERROR

          public static final int JCAS_ERROR

      {0}
      See Also:
        Constant Field Values

    - #### DUPLICATE_FEATURE

          public static final int DUPLICATE_FEATURE

      Trying to define feature "{0}" on type "{1}" with range "{2}", but feature has already been defined on (super)type "{3}" with range "{4}".
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CASAdminException

          public CASAdminException(int error)

      Create a new `CASAdminException`
      Parameters:
        `error` - The error code.

  - ### Method Detail

    - #### getError

          public int getError()

      Returns:
        The error code for the exception. This may be useful when the error needs to be handed over language boundaries. Instead of handing over the complete exception object, return the error code, and the receiving application can look up the error in the message file. Unfortunately, the error parameters get lost that way.

    - #### getMessage

          public String getMessage()

      Overrides:
        `getMessage` in class `Throwable`
      Returns:
        The message of the exception. Useful for including the text in another exception.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Throwable`
      Returns:
        The same as getMessage(), but prefixed with `"CASAdminException: "`.

    - #### addArgument

          public boolean addArgument(String s)

      Add an argument to a `CASAdminException` object. Excess arguments will be ignored, and missing arguments will have the value `null`. Add arguments in the order in which they are specified in the message catalog (i.e. add %1 first, %2 next, and so on). Adding a `null String` has no effect! So if you don't know the value of an argument, use something like `""` or `"UNKNOWN"`, but not `null`.
      Parameters:
        `s` - the argument to add
      Returns:
        true if the argument was added

    - #### getMessageCode

          public String getMessageCode()

      Get the string identifier for this exception.
      Returns:
        The internal message key.

    - #### getArguments

          public String[] getArguments()

      Get the arguments to the exception string.
      Returns:
        The arguments to the exception.

    - #### getBundleShortName

          public String getBundleShortName()

      Get the short name of the message bundle, i.e., the name without the package prefix.
      Returns:
        The short name of the message bundle.

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