Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.birt.core.exception
Class BirtException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.eclipse.birt.core.exception.BirtException

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  CoreException, FrameworkException

    public class BirtException

extends java.lang.Exception

Define BIRT's Exception framework. Every BIRT exception has to include an error code, which is a string. Different BIRT modules use different prefix for error codes. For example,

- DE uses DESIGN_EXCEPTION_
- DtE uses DATA_EXCEPTION_
- FPE uses GENERATION_EXCEPTION_ and VIEW_EXCEPTION_
- UI uses UI_EXCEPTION_
- Chart used CHART_EXCEPTION_
- viewer uses VIERER_EXCEPTION_
as prefix. An error code is used for retrieving error message, which is externalizable, and can be seen by end users. The error code itself allows the identification of the subcomponent that generates the exception, avoiding the need to create exceltion subclasses such as BirtEngineException, BirtDtEException, etc. Note that the resource key (or error code), message arguments and resource bundle are immutable.

See Also:
  Serialized Form

Field Summary
`static int` | `CANCEL` Status type severity (bit mask, value 8) indicating this exception represents a cancelation
`static int` | `ERROR` Status type severity (bit mask, value 4) indicating this exception represents an error.
`static int` | `INFO` Status type severity (bit mask, value 1) indicating this exception is informational only.
`protected java.lang.Object[]` | `oaMessageArguments` Optional arguments to be used with a resource key to build the error message
`static int` | `OK` Status severity constant (value 0) indicating this exception represents the nominal case.
`protected java.lang.String` | `pluginId` The unique identifier of the plug-in associated with this exception
`protected java.util.ResourceBundle` | `rb` The resource bundle that holds a collection of messages for a specific locale
`protected int` | `severity` The severity of this exception.
`protected java.lang.String` | `sResourceKey` The resource key that represents the internal error code used in fetching an externalized message
`static int` | `WARNING` Status type severity (bit mask, value 2) indicating this exception represents a warning.

Constructor Summary
`BirtException()`
`BirtException(java.lang.String errorCode, java.lang.Object arg0)` Deprecated.
`BirtException(java.lang.String errorCode, java.lang.Object[] args, java.util.ResourceBundle bundle)` Deprecated.
`BirtException(java.lang.String errorCode, java.lang.Object[] args, java.util.ResourceBundle bundle, java.lang.Throwable cause)` Deprecated.
`BirtException(java.lang.String errorCode, java.lang.Object[] args, java.lang.Throwable cause)` Deprecated.
`BirtException(java.lang.String errorCode, java.lang.Object arg0, java.util.ResourceBundle bundle)` Deprecated.
`BirtException(java.lang.String errorCode, java.lang.Object arg0, java.util.ResourceBundle bundle, java.lang.Throwable cause)` Deprecated.
`BirtException(java.lang.String errorCode, java.util.ResourceBundle bundle)` Deprecated. Constructs a new Birt exception with no cause object.
`BirtException(java.lang.String errorCode, java.util.ResourceBundle bundle, java.lang.Throwable cause)` Deprecated.
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.lang.Object arg0)`
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.lang.Object[] args, java.util.ResourceBundle bundle)`
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.lang.Object[] args, java.util.ResourceBundle bundle, java.lang.Throwable cause)`
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.lang.Object[] args, java.lang.Throwable cause)`
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.lang.Object arg0, java.util.ResourceBundle bundle)`
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.lang.Object arg0, java.util.ResourceBundle bundle, java.lang.Throwable cause)`
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.util.ResourceBundle bundle)` Constructs a new Birt exception with no cause object.
`BirtException(java.lang.String pluginId, java.lang.String errorCode, java.util.ResourceBundle bundle, java.lang.Throwable cause)`

Method Summary
`java.lang.String` | `getErrorCode()`
`java.lang.String` | `getLocalizedMessage()`
`protected java.lang.String` | `getLocalizedMessage(java.lang.String errorCode)` Returns a localized message based on an error code.
`java.lang.String` | `getMessage()`
`java.lang.String` | `getPluginId()` Returns the unique identifier of the plug-in associated with this exception (this is the plug-in that defines the meaning of the error code).
`int` | `getSeverity()` Returns the severity.
`void` | `setSeverity(int severity)` Sets the severity of the exception.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, 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

### sResourceKey

    protected final java.lang.String sResourceKey

  The resource key that represents the internal error code used in fetching an externalized message

### oaMessageArguments

    protected final java.lang.Object[] oaMessageArguments

  Optional arguments to be used with a resource key to build the error message

### rb

    protected final java.util.ResourceBundle rb

  The resource bundle that holds a collection of messages for a specific locale

### pluginId

    protected java.lang.String pluginId

  The unique identifier of the plug-in associated with this exception

### severity

    protected int severity

  The severity of this exception. One of
  - `CANCEL`
  - `ERROR` (default value)
  - `WARNING`
  - `INFO`
  - or `OK` (0)

### OK

    public static final int OK

  Status severity constant (value 0) indicating this exception represents the nominal case. This constant is also used as the status code representing the nominal case.

  See Also:
    `getSeverity()`, Constant Field Values

### INFO

    public static final int INFO

  Status type severity (bit mask, value 1) indicating this exception is informational only.

  See Also:
    `getSeverity()`, Constant Field Values

### WARNING

    public static final int WARNING

  Status type severity (bit mask, value 2) indicating this exception represents a warning.

  See Also:
    `getSeverity()`, Constant Field Values

### ERROR

    public static final int ERROR

  Status type severity (bit mask, value 4) indicating this exception represents an error.

  See Also:
    `getSeverity()`, Constant Field Values

### CANCEL

    public static final int CANCEL

  Status type severity (bit mask, value 8) indicating this exception represents a cancelation

  See Also:
    `getSeverity()`, Constant Field Values

Constructor Detail

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.util.ResourceBundle bundle)

  Deprecated. Constructs a new Birt exception with no cause object.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.util.ResourceBundle bundle,
                         java.lang.Throwable cause)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.
    `cause` - the nested exception

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.lang.Object[] args,
                         java.util.ResourceBundle bundle,
                         java.lang.Throwable cause)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.
    `args` - string arguments used to format error messages

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.lang.Object arg0,
                         java.util.ResourceBundle bundle,
                         java.lang.Throwable cause)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.
    `cause` - the nested exception
    `arg0` - first argument used to format error messages

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.lang.Object[] args,
                         java.util.ResourceBundle bundle)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.
    `args` - string arguments used to format error messages

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.lang.Object arg0,
                         java.util.ResourceBundle bundle)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.
    `cause` - the nested exception
    `arg0` - first argument used to format error messages

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.lang.Object arg0)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `arg0` - first argument used to format error messages

### BirtException

    public BirtException(java.lang.String errorCode,
                         java.lang.Object[] args,
                         java.lang.Throwable cause)

  Deprecated.

  Parameters:
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `cause` - the nested exception
    `args` - string arguments used to format error messages

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.util.ResourceBundle bundle)

  Constructs a new Birt exception with no cause object.

  Parameters:
    `pluginId` - Returns the unique identifier of the plug-in associated with this exception *
    `errorCode` - used to retrieve a piece of externalized message displayed to end user.
    `resourceBundle` - the resourceBundle used to translate the message.

### BirtException

    public BirtException()

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.util.ResourceBundle bundle,
                         java.lang.Throwable cause)

Parameters:
  `pluginId` - Returns the unique identifier of the plug-in associated with this exception
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `resourceBundle` - the resourceBundle used to translate the message.
  `cause` - the nested exception

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.lang.Object[] args,
                         java.util.ResourceBundle bundle,
                         java.lang.Throwable cause)

Parameters:
  `pluginId` - Returns the unique identifier of the plug-in associated with this exception
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `resourceBundle` - the resourceBundle used to translate the message.
  `args` - string arguments used to format error messages

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.lang.Object arg0,
                         java.util.ResourceBundle bundle,
                         java.lang.Throwable cause)

Parameters:
  `pluginId` - Returns the unique identifier of the plug-in associated with this exception
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `resourceBundle` - the resourceBundle used to translate the message.
  `cause` - the nested exception
  `arg0` - first argument used to format error messages

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.lang.Object[] args,
                         java.util.ResourceBundle bundle)

Parameters:
  `pluginId` - Returns the unique identifier of the plug-in associated with this exception
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `resourceBundle` - the resourceBundle used to translate the message.
  `args` - string arguments used to format error messages

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.lang.Object arg0,
                         java.util.ResourceBundle bundle)

Parameters:
  `pluginId` - Returns the unique identifier of the plug-in associated with this exception
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `resourceBundle` - the resourceBundle used to translate the message.
  `cause` - the nested exception
  `arg0` - first argument used to format error messages

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.lang.Object arg0)

Parameters:
  `pluginId` - Returns the unique identifier of the plug-in associated with this exception
  `severity` -
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `arg0` - first argument used to format error messages

### BirtException

    public BirtException(java.lang.String pluginId,
                         java.lang.String errorCode,
                         java.lang.Object[] args,
                         java.lang.Throwable cause)

Parameters:
  `errorCode` - used to retrieve a piece of externalized message displayed to end user.
  `cause` - the nested exception
  `args` - string arguments used to format error messages

Method Detail

### getErrorCode

    public java.lang.String getErrorCode()

  Returns:
    Returns the errorCode.

### getLocalizedMessage

    public java.lang.String getLocalizedMessage()

  Overrides:
    `getLocalizedMessage` in class `java.lang.Throwable`

### getMessage

    public java.lang.String getMessage()

  Overrides:
    `getMessage` in class `java.lang.Throwable`

### getLocalizedMessage

    protected java.lang.String getLocalizedMessage(java.lang.String errorCode)

  Returns a localized message based on an error code. Overwrite this method if you do not want to pass in the resource bundle

  Parameters:
    `errorCode` - the error code
  Returns:
    Localized display message.

### getPluginId

    public java.lang.String getPluginId()

  Returns the unique identifier of the plug-in associated with this exception (this is the plug-in that defines the meaning of the error code).

  Returns:
    the unique identifier of the relevant plug-in

### getSeverity

    public int getSeverity()

  Returns the severity. The severities are as follows (in descending order):
  - `CANCEL`- cancelation occurred
  - `ERROR`- a serious error (most severe)
  - `WARNING`- a warning (less severe)
  - `INFO`- an informational ("fyi") message (least severe)
  - `OK`- everything is just fine

  Returns:
    the severity: one of `OK`,`ERROR`, `INFO`,`WARNING`, or `CANCEL`

### setSeverity

    public void setSeverity(int severity)

  Sets the severity of the exception.

  Parameters:
    `severity` - the severity; one of `OK`,`ERROR`, `INFO`,`WARNING`, or `CANCEL`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008 Actuate Corp. All rights reserved.