org.apache.uima.cas.impl

## Class XCASParsingException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - org.xml.sax.SAXException
      - - org.xml.sax.SAXParseException
        - - org.apache.uima.cas.impl.XCASParsingException

- All Implemented Interfaces:
    Serializable

      public class XCASParsingException
      extends SAXParseException

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ARRAY_ELE_ATTRS` Error parsing XCAS from source {0} at line {1}, column {2}: array element <i> may not have attributes.
    `static int` | `ARRAY_ELE_EXPECTED` Error parsing XCAS from source {0} at line {1}, column {2}: expected array element <i> but found: <{3}>.
    `static int` | `BYTE_ARRAY_LENGTH_NOT_EVEN` Error parsing XMI-CAS from source {0} at line {1}, column {2}: A byte array value must have an even number of hex characters.
    `static int` | `EXCESS_ARRAY_ELE` Error parsing XCAS from source {0} at line {1}, column {2}: number of array elements exceeds specified array size.
    `static int` | `FLOAT_EXPECTED` Error parsing XCAS from source {0} at line {1}, column {2}: expected numeric value, but found: {3}.
    `static int` | `ILLEGAL_ARRAY_ATTR` Error parsing XCAS from source {0} at line {1}, column {2}: unknown attribute for array type: {3}.
    `static int` | `ILLEGAL_ARRAY_SIZE` Error parsing XCAS from source {0} at line {1}, column {2}: size of array must be >= 0, but is: {3}.
    `static int` | `ILLEGAL_ID` Error parsing XCAS from source {0} at line {1}, column {2}: value of _id attribute must be integer, but is: {3}.
    `static int` | `INTEGER_EXPECTED` Error parsing XCAS from source {0} at line {1}, column {2}: expected integer value, but found: {3}.
    `static int` | `SOFA_REF_MISSING` Error parsing XCAS or XMI-CAS from source {0} at line {1}, column {2}: in subtype of AnnotationBase, sofa reference is missing.
    `static int` | `TEXT_EXPECTED` Error parsing XCAS from source {0} at line {1}, column {2}: expected text but found element: <{3}>.
    `static int` | `UNKNOWN_FEATURE` Error parsing XCAS from source {0} at line {1}, column {2}: unknown feature: {3}.
    `static int` | `UNKNOWN_ID` Error parsing XMI-CAS from source {0} at line {1}, column {2}: xmi id {3} is referenced but not defined.
    `static int` | `UNKNOWN_TYPE` Error parsing XCAS from source {0} at line {1}, column {2}: unknown type: {3}.
    `static int` | `WRONG_ROOT_TAG` Error parsing XCAS from source {0} at line {1}, column {2}: expected <CAS> root tag but found: <{3}>.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `addArgument(String s)` Add an argument to a `XCASParsingException` object.
    `int` | `getError()`
    `String` | `getMessage()`
    `String` | `toString()`

    - ### Methods inherited from class org.xml.sax.SAXParseException

      `getColumnNumber, getLineNumber, getPublicId, getSystemId`

    - ### Methods inherited from class org.xml.sax.SAXException

      `getCause, getException`

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

      `addSuppressed, fillInStackTrace, 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

    - #### WRONG_ROOT_TAG

          public static final int WRONG_ROOT_TAG

      Error parsing XCAS from source {0} at line {1}, column {2}: expected <CAS> root tag but found: <{3}>.
      See Also:
        Constant Field Values

    - #### TEXT_EXPECTED

          public static final int TEXT_EXPECTED

      Error parsing XCAS from source {0} at line {1}, column {2}: expected text but found element: <{3}>.
      See Also:
        Constant Field Values

    - #### ARRAY_ELE_EXPECTED

          public static final int ARRAY_ELE_EXPECTED

      Error parsing XCAS from source {0} at line {1}, column {2}: expected array element <i> but found: <{3}>.
      See Also:
        Constant Field Values

    - #### ARRAY_ELE_ATTRS

          public static final int ARRAY_ELE_ATTRS

      Error parsing XCAS from source {0} at line {1}, column {2}: array element <i> may not have attributes.
      See Also:
        Constant Field Values

    - #### UNKNOWN_TYPE

          public static final int UNKNOWN_TYPE

      Error parsing XCAS from source {0} at line {1}, column {2}: unknown type: {3}.
      See Also:
        Constant Field Values

    - #### ILLEGAL_ID

          public static final int ILLEGAL_ID

      Error parsing XCAS from source {0} at line {1}, column {2}: value of _id attribute must be integer, but is: {3}.
      See Also:
        Constant Field Values

    - #### ILLEGAL_ARRAY_SIZE

          public static final int ILLEGAL_ARRAY_SIZE

      Error parsing XCAS from source {0} at line {1}, column {2}: size of array must be >= 0, but is: {3}.
      See Also:
        Constant Field Values

    - #### ILLEGAL_ARRAY_ATTR

          public static final int ILLEGAL_ARRAY_ATTR

      Error parsing XCAS from source {0} at line {1}, column {2}: unknown attribute for array type: {3}.
      See Also:
        Constant Field Values

    - #### UNKNOWN_FEATURE

          public static final int UNKNOWN_FEATURE

      Error parsing XCAS from source {0} at line {1}, column {2}: unknown feature: {3}.
      See Also:
        Constant Field Values

    - #### INTEGER_EXPECTED

          public static final int INTEGER_EXPECTED

      Error parsing XCAS from source {0} at line {1}, column {2}: expected integer value, but found: {3}.
      See Also:
        Constant Field Values

    - #### FLOAT_EXPECTED

          public static final int FLOAT_EXPECTED

      Error parsing XCAS from source {0} at line {1}, column {2}: expected numeric value, but found: {3}.
      See Also:
        Constant Field Values

    - #### EXCESS_ARRAY_ELE

          public static final int EXCESS_ARRAY_ELE

      Error parsing XCAS from source {0} at line {1}, column {2}: number of array elements exceeds specified array size.
      See Also:
        Constant Field Values

    - #### UNKNOWN_ID

          public static final int UNKNOWN_ID

      Error parsing XMI-CAS from source {0} at line {1}, column {2}: xmi id {3} is referenced but not defined.
      See Also:
        Constant Field Values

    - #### SOFA_REF_MISSING

          public static final int SOFA_REF_MISSING

      Error parsing XCAS or XMI-CAS from source {0} at line {1}, column {2}: in subtype of AnnotationBase, sofa reference is missing.
      See Also:
        Constant Field Values

    - #### BYTE_ARRAY_LENGTH_NOT_EVEN

          public static final int BYTE_ARRAY_LENGTH_NOT_EVEN

      Error parsing XMI-CAS from source {0} at line {1}, column {2}: A byte array value must have an even number of hex characters.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### XCASParsingException

          public XCASParsingException(int error)

      Create a new `XCASParsingException`
      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 `SAXException`
      Returns:
        The message of the exception. Useful for including the text in another exception.

    - #### toString

          public String toString()

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

    - #### addArgument

          public boolean addArgument(String s)

      Add an argument to a `XCASParsingException` 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, false if the argument was already added or was out of range

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