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

## org.eclipse.hyades.logging.events.cbe
Class EventException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.eclipse.hyades.logging.events.cbe.EventException

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  CompletionException, FormattingException, ValidationException

public class EventException
extends java.lang.Exception

Base for all exceptions in CBE package. The `EventException` class is a subclass of `java.lang.Exception` that provides support for exception chaining semantics that will be available in the 1.4 timeframe. Exceptions that desire to inherit these semantics while running on pre 1.4 JDKs should extend this class.

It should be noted that this class will provide only the exception chaining semantics available in 1.4. This is a subset of all the new functionality. introduced in 1.4. Most of that functionality requires support from the JVM that is not available on earlier editions.

Exceptions that subclass this exception only need to add the various constructors and inherit everything else from this class.

See the javadoc for the JDK 1.4 java.lang.Throwable for a full description of the exception chaining functionality.

`EventException` alse provides support for localized (language-specific) messages.

A `EventException` contains the following components:

- A "key" which selects the text to be displayed from the message file. (Separating the text from the classes which use it allows the text to be translated into different national languages.)
- A message file, which contains a set of messages that might be displayed. Entries in the message file are stored as "key=value" pairs.
- A set of `Objects` which can be inserted into the message text. These parameters are required only if the message expects them. These objects are processed according to the rules of the `java.text.MessageFormat` class.
- A nested `Exception` whose message text will be displayed along with that of this `EventException`.

Since:
  1.0.1
Version:
  1.0.1
Author:
  Denilson Nastacio
See Also:
  Serialized Form

Field Summary
`protected java.lang.String` | `file` Base name of the ResourceBundle in which the text is found.
`protected java.lang.String` | `key` The key of the message associated with this text.
`protected java.lang.Object[]` | `parms` Parameters to be included in the message.

Constructor Summary
`EventException()` Construct a new `EventException` with a null detail message and an uninitialized cause filed.
`EventException(java.lang.String message)` Construct a new `EventException` with the specified detail message and an uninitialized cause field.
`EventException(java.lang.String key, java.lang.String file)` Creates a `EventException` with a detail message, message translation information (resource bundle, message key and message substitutions).
`EventException(java.lang.String key, java.lang.String file, java.lang.Object[] parms)` Creates a `EventException` with a detail message, message translation information (resource bundle, message key and message substitutions).
`EventException(java.lang.String key, java.lang.String file, java.lang.Object[] parms, java.lang.Throwable cause)` Creates a `EventException` with a detail message, message translation information (resource bundle, message key and message substitutions) and a nested exception.
`EventException(java.lang.String message, java.lang.Throwable cause)` Construct a new `EventException` with a null detail message and a cause field set to the specified Throwable.
`EventException(java.lang.Throwable cause)` Construct a new `EventException` with a null detail message and a cause field set to the specified Throwable.

Method Summary
`java.lang.Throwable` | `getCause()` Return the Throwable that is considered the root cause of this `EventException`.
`java.lang.String` | `getKey()` Gets the message key.
`java.lang.String` | `getLocalizedMessage()` Gets the text of the exception message, translated into the current locale.
`java.lang.String` | `getLocalizedMessage(java.util.Locale locale)` Gets the text of the exception message, translated into the specified locale.
`java.lang.String` | `getMessage()` Gets the text of the exception message.
`java.lang.Throwable` | `initCause(java.lang.Throwable cause)` Initialize the cause field for this `EventException` to the specified value.
`void` | `printStackTrace()` Print this `EventException` and its backtrace to System.err.
`void` | `printStackTrace(java.io.PrintStream stream)` Print this `EventException` and its backtrace to the specified print stream.
`void` | `printStackTrace(java.io.PrintWriter writer)` Print this `EventException` and its backtrace to the specified print writer.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### file

    protected java.lang.String file

  Base name of the ResourceBundle in which the text is found.

### key

    protected java.lang.String key

  The key of the message associated with this text.

### parms

    protected java.lang.Object[] parms

  Parameters to be included in the message.

Constructor Detail

### EventException

    public EventException()

  Construct a new `EventException` with a null detail message and an uninitialized cause filed. The cause may subsequently be initialized via calling the `initCause(java.lang.Throwable)` method.

### EventException

    public EventException(java.lang.String message)

  Construct a new `EventException` with the specified detail message and an uninitialized cause field. The cause may subsequently be initialized via calling the `initCause(java.lang.Throwable)` method.

Parameters:
  `message` - a detail message. Null is tolerated.

### EventException

    public EventException(java.lang.String key,
                          java.lang.String file)

  Creates a `EventException` with a detail message, message translation information (resource bundle, message key and message substitutions).

Parameters:
  `key` - The message key.
  `file` - The name of the message file to use.

### EventException

    public EventException(java.lang.Throwable cause)

  Construct a new `EventException` with a null detail message and a cause field set to the specified Throwable. Subsequent calls to the `initCause(java.lang.Throwable)` method on this instance will result in an exception. The value of the cause field may be retrieved at any time via the `getCause()` method.

Parameters:
  `cause` - the Throwable that was caught and is considered the root cause of this exception. Null is tolerated.

### EventException

    public EventException(java.lang.String message,
                          java.lang.Throwable cause)

  Construct a new `EventException` with a null detail message and a cause field set to the specified Throwable. Subsequent calls to the `initCause(java.lang.Throwable)` method on this instance will result in an exception. The value of the cause field may be retrieved at any time via the `getCause()` method.

Parameters:
  `message` - the detail message. Null is tolerated.
  `cause` - the Throwable that was caught and is considered the root cause of this exception. Null is tolerated.

### EventException

    public EventException(java.lang.String key,
                          java.lang.String file,
                          java.lang.Object[] parms)

  Creates a `EventException` with a detail message, message translation information (resource bundle, message key and message substitutions).

Parameters:
  `key` - The message key.
  `file` - The name of the message file to use.
  `parms` - An array of elements to be inserted into the message.

### EventException

    public EventException(java.lang.String key,
                          java.lang.String file,
                          java.lang.Object[] parms,
                          java.lang.Throwable cause)

  Creates a `EventException` with a detail message, message translation information (resource bundle, message key and message substitutions) and a nested exception.

Parameters:
  `key` - The message key.
  `file` - The name of the message file to use.
  `parms` - An array of elements to be inserted into the message.
  `cause` - The nested exception, or `null`, if a nested exception is not appropriate.

Method Detail

### getCause

    public java.lang.Throwable getCause()

  Return the Throwable that is considered the root cause of this `EventException`. Null is returned if the root cause is nonexistent or unknown. The root cause is the throwable that caused this `EventException` to get thrown.

  The Throwable that is returned is either the Throwable supplied via one of the appropriate constructors, or that set via the `initCause(Throwable)` method. While it is typically unnecessary to override this method, a subclass can override it to return a cause set by some other means, such as a legacy exception chaining infrastructure.

  Returns:
    the Throwable that is the cause of this `EventException`, or null if the cause is nonexistent or unknown.

### getKey

    public java.lang.String getKey()

  Gets the message key. The result is the key of the message associated with this text.

  Returns:
    String The message key .

### getLocalizedMessage

    public java.lang.String getLocalizedMessage()

  Gets the text of the exception message, translated into the current locale.

  Returns:
    The localized exception message.

### getLocalizedMessage

    public java.lang.String getLocalizedMessage(java.util.Locale locale)

  Gets the text of the exception message, translated into the specified locale.

  Parameters:
    `locale` - The locale to use for translation of the exception message, or `null` to use the default locale.
  Returns:
    The localized exception message.

### getMessage

    public java.lang.String getMessage()

  Gets the text of the exception message. The result is the same as that returned by `getLocalizedMessage(Locale.ENGLISH)`.

  Returns:
    The exception message.

### initCause

    public java.lang.Throwable initCause(java.lang.Throwable cause)
                                  throws java.lang.IllegalStateException,
                                         java.lang.IllegalArgumentException

  Initialize the cause field for this `EventException` to the specified value. The cause is the Throwable that caused this `EventException` to get thrown.

  This method can be called at most once. It is generally called from within a constructor that takes a Throwable, or immediately after constructing this object with a constructor that does not accept a Throwable. Thus, if a constructor that takes Throwable as a parameter is used to construct this object, it cannot be called at all.

  Parameters:
    `cause` - the Throwable which caused this `EventException` to be thrown. Null is tolerated.
  Returns:
    a reference to this `Throwable` instance.
  Throws:
    `java.lang.IllegalStateException` - if this `EventException` was created with a constructor that specified a cause, or this method has already been called on this object.
    `java.lang.IllegalArgumentException` - if the specified cause is this `EventException`. An exception cannot be its own cause.

### printStackTrace

    public void printStackTrace()

  Print this `EventException` and its backtrace to System.err.

### printStackTrace

    public void printStackTrace(java.io.PrintStream stream)

  Print this `EventException` and its backtrace to the specified print stream.

  Parameters:
    `stream` - the PrintStream to use for output

### printStackTrace

    public void printStackTrace(java.io.PrintWriter writer)

  Print this `EventException` and its backtrace to the specified print writer.

  Parameters:
    `writer` - the PrintWriter to use for output

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