Extension SDK 10.1.2

oracle.ide.util
Class NestedException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byoracle.ide.util.NestedException
All Implemented Interfaces:
java.io.Serializable

public class NestedException
extends java.lang.Exception

This is a utility exception which can be used to nest another exception (usually the exception that caused this one to take place).

See Also:
Serialized Form

Field Summary
protected static int DEFAULT_SEVERITY
           
static int SEV_DONT_DISPLAY
          Signals that this exception should never be displayed for the user but is being used by the code logic to escape from some situation (e.g.
static int SEV_ERROR
          Signals that this exception is a normal error message.
static int SEV_FATAL
          Signals that this exception is a fatal error.
static int SEV_INFORMATIONAL
          Signals that this exception is an informational message and can safely be ignored by the user
static int SEV_WARNING
          Signals that this exception is a warning message.
 
Constructor Summary
NestedException()
          Construct an empty nested exception.
NestedException(java.lang.String error)
          Construct a NestedException with the specified error message.
NestedException(java.lang.String error, int severity)
          Construct a NestedException with the specified error message.
NestedException(java.lang.String error, java.lang.Object[] subst)
           
NestedException(java.lang.String error, java.lang.Object[] subst, int severity)
           
NestedException(java.lang.String error, java.lang.Object[] subst, java.lang.Throwable target)
           
NestedException(java.lang.String error, java.lang.Object[] subst, java.lang.Throwable target, int severity)
           
NestedException(java.lang.String error, java.lang.Throwable target)
          Construct a NestedException with an error message, a target throwable and indicate whether it was an expected error
NestedException(java.lang.String error, java.lang.Throwable target, int severity)
          Construct a NestedException with an error message, a target throwable and indicate whether it was an expected error
NestedException(java.lang.Throwable target)
           
NestedException(java.lang.Throwable target, int severity)
           
 
Method Summary
 int getSeverity()
          How severe was the exception? This is used by the exception handler to determine how to display the error message for the exception.
static java.lang.String getStackTrace(java.lang.Throwable t)
          Given an exception, get the stack trace as a String.
 java.lang.Throwable getTarget()
          Get the exception that caused this exception
 java.lang.String getTitle()
          Get the title to use when this exception is displayed in an alert.
 void setSeverity(int severity)
           
 void setTarget(java.lang.Throwable target)
          Set the exception that caused this exception
 void setTitle(java.lang.String title)
          Sets the title to use when this exception is displayed in an alert.
 
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

SEV_DONT_DISPLAY

public static final int SEV_DONT_DISPLAY
Signals that this exception should never be displayed for the user but is being used by the code logic to escape from some situation (e.g. the user cancelled a dialog, and a CancelException was thrown, but we don't want to display a message

See Also:
Constant Field Values

SEV_INFORMATIONAL

public static final int SEV_INFORMATIONAL
Signals that this exception is an informational message and can safely be ignored by the user

See Also:
Constant Field Values

SEV_WARNING

public static final int SEV_WARNING
Signals that this exception is a warning message. The user is strongly advised (or even required) to pay attention to the message. This is the default severity.

See Also:
Constant Field Values

SEV_ERROR

public static final int SEV_ERROR
Signals that this exception is a normal error message. This would be a user error or external system error. Indicates that something went wrong.

See Also:
Constant Field Values

SEV_FATAL

public static final int SEV_FATAL
Signals that this exception is a fatal error. This means that the software has failed, usually that the error which occurred was unexpected (i.e. in the same class as a RuntimeException)

See Also:
Constant Field Values

DEFAULT_SEVERITY

protected static final int DEFAULT_SEVERITY
See Also:
Constant Field Values
Constructor Detail

NestedException

public NestedException()
Construct an empty nested exception. Automatically sets the severity to SEV_DONT_DISPLAY


NestedException

public NestedException(java.lang.String error,
                       int severity)
Construct a NestedException with the specified error message.


NestedException

public NestedException(java.lang.String error,
                       java.lang.Object[] subst,
                       int severity)

NestedException

public NestedException(java.lang.Throwable target,
                       int severity)

NestedException

public NestedException(java.lang.String error,
                       java.lang.Throwable target,
                       int severity)
Construct a NestedException with an error message, a target throwable and indicate whether it was an expected error

Parameters:
error - the error message. May be null.
target - An exception which caused this exception. May be null.

NestedException

public NestedException(java.lang.String error,
                       java.lang.Object[] subst,
                       java.lang.Throwable target,
                       int severity)

NestedException

public NestedException(java.lang.String error)
Construct a NestedException with the specified error message.


NestedException

public NestedException(java.lang.String error,
                       java.lang.Object[] subst)

NestedException

public NestedException(java.lang.Throwable target)

NestedException

public NestedException(java.lang.String error,
                       java.lang.Throwable target)
Construct a NestedException with an error message, a target throwable and indicate whether it was an expected error

Parameters:
error - the error message. May be null.
target - An exception which caused this exception. May be null.

NestedException

public NestedException(java.lang.String error,
                       java.lang.Object[] subst,
                       java.lang.Throwable target)
Method Detail

setSeverity

public void setSeverity(int severity)

getSeverity

public int getSeverity()
How severe was the exception? This is used by the exception handler to determine how to display the error message for the exception.

Returns:
one of the SEV_constants

setTarget

public void setTarget(java.lang.Throwable target)
Set the exception that caused this exception


getTarget

public java.lang.Throwable getTarget()
Get the exception that caused this exception


getStackTrace

public static java.lang.String getStackTrace(java.lang.Throwable t)
Given an exception, get the stack trace as a String.


setTitle

public void setTitle(java.lang.String title)
Sets the title to use when this exception is displayed in an alert.

Parameters:
title - the text to display in alerts for this exception

getTitle

public java.lang.String getTitle()
Get the title to use when this exception is displayed in an alert.

Returns:
a string title for the alert. The default is to have no title.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.