com.ibm.icu4jni.common
Class ErrorCode

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.ibm.icu4jni.common.ErrorCode
All Implemented Interfaces:
java.io.Serializable

public final class ErrorCode
extends java.lang.Exception

Error exception class mapping ICU error codes of the enum UErrorCode

See Also:
Serialized Form
Status:
Internal. This API is Internal Only and can change at any time.

Field Summary
static boolean LIBRARY_LOADED
          Load library flag
static int U_BUFFER_OVERFLOW_ERROR
          A result would not fit in the supplied buffer
static int U_ERROR_INFO_LIMIT
          This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1)
static int U_ERROR_INFO_START
          Start of information results (semantically successful)
static int U_ERROR_LIMIT
          This must always be the last value to indicate the limit for UErrorCode (last error code +1)
static int U_FILE_ACCESS_ERROR
           
static int U_ILLEGAL_ARGUMENT_ERROR
          Start of codes indicating failure
static int U_ILLEGAL_CHAR_FOUND
          In codeset conversion: a sequence that does NOT belong in the codepage has been encountered
static int U_ILLEGAL_ESCAPE_SEQUENCE
          ISO-2022 illlegal escape sequence
static int U_INDEX_OUTOFBOUNDS_ERROR
           
static int U_INTERNAL_PROGRAM_ERROR
          Indicates a bug in the library code
static int U_INVALID_CHAR_FOUND
          In the Character conversion routines: Invalid character or sequence was encountered
static int U_INVALID_FORMAT_ERROR
           
static int U_INVALID_TABLE_FILE
          Conversion table file not found
static int U_INVALID_TABLE_FORMAT
          Conversion table file found, but corrupted
static int U_MEMORY_ALLOCATION_ERROR
          Memory allocation error
static int U_MESSAGE_PARSE_ERROR
           
static int U_MISSING_RESOURCE_ERROR
           
static int U_NO_SPACE_AVAILABLE
          No space available for in-buffer expansion for Arabic shaping
static int U_PARSE_ERROR
          Equivalent to Java ParseException
static int U_RESOURCE_TYPE_MISMATCH
          an operation is requested over a resource that does not support it
static int U_SAFECLONE_ALLOCATED_ERROR
          A SafeClone operation required allocating memory (informational only
static int U_TRUNCATED_CHAR_FOUND
          In the Character conversion routines: More bytes are required to complete the conversion successfully
static int U_UNSUPPORTED_ERROR
          Requested operation not supported in current context
static int U_UNSUPPORTED_ESCAPE_SEQUENCE
          ISO-2022 unsupported escape sequence
static int U_USING_DEFAULT_ERROR
          A resource bundle lookup returned a result from the root locale (not an error)
static int U_USING_FALLBACK_ERROR
          A resource bundle lookup returned a fallback result (not an error)
static int U_ZERO_ERROR
          No error, no warning
 
Constructor Summary
ErrorCode()
           
 
Method Summary
static java.lang.String getErrorName(int ec)
          Returns the error name of the input error code
static java.lang.RuntimeException getException(int error)
          Generic mapping from the error codes to java default exceptions.
static boolean isFailure(int ec)
          Returns true if the input error code denotes failure
static boolean isSuccess(int ec)
          Returns true if the input error code denotes success
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

U_ERROR_INFO_START

public static final int U_ERROR_INFO_START
Start of information results (semantically successful)

See Also:
Constant Field Values

U_USING_FALLBACK_ERROR

public static final int U_USING_FALLBACK_ERROR
A resource bundle lookup returned a fallback result (not an error)

See Also:
Constant Field Values

U_USING_DEFAULT_ERROR

public static final int U_USING_DEFAULT_ERROR
A resource bundle lookup returned a result from the root locale (not an error)

See Also:
Constant Field Values

U_SAFECLONE_ALLOCATED_ERROR

public static final int U_SAFECLONE_ALLOCATED_ERROR
A SafeClone operation required allocating memory (informational only

See Also:
Constant Field Values

U_ERROR_INFO_LIMIT

public static final int U_ERROR_INFO_LIMIT
This must always be the last warning value to indicate the limit for UErrorCode warnings (last warning code +1)

See Also:
Constant Field Values

U_ZERO_ERROR

public static final int U_ZERO_ERROR
No error, no warning

See Also:
Constant Field Values

U_ILLEGAL_ARGUMENT_ERROR

public static final int U_ILLEGAL_ARGUMENT_ERROR
Start of codes indicating failure

See Also:
Constant Field Values

U_MISSING_RESOURCE_ERROR

public static final int U_MISSING_RESOURCE_ERROR
See Also:
Constant Field Values

U_INVALID_FORMAT_ERROR

public static final int U_INVALID_FORMAT_ERROR
See Also:
Constant Field Values

U_FILE_ACCESS_ERROR

public static final int U_FILE_ACCESS_ERROR
See Also:
Constant Field Values

U_INTERNAL_PROGRAM_ERROR

public static final int U_INTERNAL_PROGRAM_ERROR
Indicates a bug in the library code

See Also:
Constant Field Values

U_MESSAGE_PARSE_ERROR

public static final int U_MESSAGE_PARSE_ERROR
See Also:
Constant Field Values

U_MEMORY_ALLOCATION_ERROR

public static final int U_MEMORY_ALLOCATION_ERROR
Memory allocation error

See Also:
Constant Field Values

U_INDEX_OUTOFBOUNDS_ERROR

public static final int U_INDEX_OUTOFBOUNDS_ERROR
See Also:
Constant Field Values

U_PARSE_ERROR

public static final int U_PARSE_ERROR
Equivalent to Java ParseException

See Also:
Constant Field Values

U_INVALID_CHAR_FOUND

public static final int U_INVALID_CHAR_FOUND
In the Character conversion routines: Invalid character or sequence was encountered

See Also:
Constant Field Values

U_TRUNCATED_CHAR_FOUND

public static final int U_TRUNCATED_CHAR_FOUND
In the Character conversion routines: More bytes are required to complete the conversion successfully

See Also:
Constant Field Values

U_ILLEGAL_CHAR_FOUND

public static final int U_ILLEGAL_CHAR_FOUND
In codeset conversion: a sequence that does NOT belong in the codepage has been encountered

See Also:
Constant Field Values

U_INVALID_TABLE_FORMAT

public static final int U_INVALID_TABLE_FORMAT
Conversion table file found, but corrupted

See Also:
Constant Field Values

U_INVALID_TABLE_FILE

public static final int U_INVALID_TABLE_FILE
Conversion table file not found

See Also:
Constant Field Values

U_BUFFER_OVERFLOW_ERROR

public static final int U_BUFFER_OVERFLOW_ERROR
A result would not fit in the supplied buffer

See Also:
Constant Field Values

U_UNSUPPORTED_ERROR

public static final int U_UNSUPPORTED_ERROR
Requested operation not supported in current context

See Also:
Constant Field Values

U_RESOURCE_TYPE_MISMATCH

public static final int U_RESOURCE_TYPE_MISMATCH
an operation is requested over a resource that does not support it

See Also:
Constant Field Values

U_ILLEGAL_ESCAPE_SEQUENCE

public static final int U_ILLEGAL_ESCAPE_SEQUENCE
ISO-2022 illlegal escape sequence

See Also:
Constant Field Values

U_UNSUPPORTED_ESCAPE_SEQUENCE

public static final int U_UNSUPPORTED_ESCAPE_SEQUENCE
ISO-2022 unsupported escape sequence

See Also:
Constant Field Values

U_NO_SPACE_AVAILABLE

public static final int U_NO_SPACE_AVAILABLE
No space available for in-buffer expansion for Arabic shaping

See Also:
Constant Field Values

U_ERROR_LIMIT

public static final int U_ERROR_LIMIT
This must always be the last value to indicate the limit for UErrorCode (last error code +1)

See Also:
Constant Field Values

LIBRARY_LOADED

public static boolean LIBRARY_LOADED
Load library flag

Constructor Detail

ErrorCode

public ErrorCode()
Method Detail

getException

public static final java.lang.RuntimeException getException(int error)
Generic mapping from the error codes to java default exceptions.

Parameters:
error - error code
Returns:
java default exception that maps to the argument error code, otherwise if error is not a valid error code, null is returned.
Status:
Stable ICU 2.4.

getErrorName

public static java.lang.String getErrorName(int ec)
Returns the error name of the input error code

Parameters:
ec - int value of the error code
Returns:
String name of the error code
Status:
Stable ICU 2.4.

isSuccess

public static boolean isSuccess(int ec)
Returns true if the input error code denotes success

Parameters:
ec - int value of the error code
Returns:
boolean
Status:
Stable ICU 2.4.

isFailure

public static boolean isFailure(int ec)
Returns true if the input error code denotes failure

Parameters:
ec - int value of the error code
Returns:
boolean
Status:
Stable ICU 2.4.