com.cafesoft.core.exception
Class NestedException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.cafesoft.core.exception.NestedException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AccessControlCheckException, AccessControlException, AttributeValueParseException, AuthException, CamsAgentException, CamsException, CamsTransportException, ClassInstantiationException, ConfigException, ConfigurationException, ConnectionPoolException, ElementFactoryException, EvaluationException, FieldException, InvalidDataTypeException, InvalidPermissionException, InvalidResourceException, InvalidResourcePatternException, LifecycleException, LoggerException, MalformedAutoLoginTokenException, MalformedSessionIdException, MethodInvocationException, MonitoredProcessException, ObjectPoolException, OverlappingPermissionsException, PersistenceException, PingException, PoolAtMaximumException, ResourcePatternException, ResourceTypeException, ServiceException, SessionAccessException, SessionControlException, SyntaxException, UnknownActionException, UnknownDataTypeException, UnknownFunctionException, UserRepositoryException

public class NestedException
extends Exception

Allows for exceptions which extend this class to chain nested exceptions. Extension to the Exception class found in Java.

This class was model heavily from the Throwable implementation found in the JDK 1.4 release. It was done such that we can immediately support JDK 1.4 when Cafesoft decides to do so.

Since:
4/23/02
See Also:
Serialized Form

Constructor Summary
NestedException()
          Create an exception with no additional information
NestedException(String message)
          Create an exception with a detailed message
NestedException(String message, Throwable cause)
          Create an exception with both a detailed message and a nested exception
NestedException(Throwable cause)
          Create an exception with a nested exception
 
Method Summary
 Throwable getCause()
          Returns the cause of this throwable or null if the cause is nonexistent or unknown.
 String getLocalizedMessage()
          Creates a localized description of this throwable.
 String getMessage()
          Returns the detail message string of this Exception.
 void printStackTrace()
          Prints this throwable and its backtrace to the standard error stream.
 void printStackTrace(PrintStream s)
          Prints this throwable and its backtrace to the specified print stream.
 void printStackTrace(PrintWriter s)
          Prints this throwable and its backtrace to the specified print writer.
 String toString()
          Returns a short description of this throwable.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NestedException

public NestedException()
Create an exception with no additional information


NestedException

public NestedException(String message)
Create an exception with a detailed message

Parameters:
message - a detailed message

NestedException

public NestedException(Throwable cause)
Create an exception with a nested exception

Parameters:
cause - a nested Throwable object

NestedException

public NestedException(String message,
                       Throwable cause)
Create an exception with both a detailed message and a nested exception

Parameters:
message - a detailed message
cause - a nested Throwable object
Method Detail

getCause

public Throwable getCause()
Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is the throwable that caused this throwable to get thrown.)

Overrides:
getCause in class Throwable
Returns:
the cause of this throwable or null if the cause is nonexistent or unknown.

getLocalizedMessage

public String getLocalizedMessage()
Creates a localized description of this throwable. Subclasses may override this method in order to produce a locale-specific message. For subclasses that do not override this method, the default implementation returns the same result as getMessage().

Overrides:
getLocalizedMessage in class Throwable
Returns:
The localized description of this throwable.

getMessage

public String getMessage()
Returns the detail message string of this Exception.

Overrides:
getMessage in class Throwable
Returns:
the detail message string of this Exception instance (which may be null).

printStackTrace

public void printStackTrace()
Prints this throwable and its backtrace to the standard error stream. This method prints a stack trace for this Throwable object on the error output stream that is the value of the field System.err.

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter s)
Prints this throwable and its backtrace to the specified print writer.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintWriter to use for output
Since:
JDK1.1

printStackTrace

public void printStackTrace(PrintStream s)
Prints this throwable and its backtrace to the specified print stream.

Overrides:
printStackTrace in class Throwable
Parameters:
s - PrintStream to use for output

toString

public String toString()
Returns a short description of this throwable.

Overrides:
toString in class Throwable
Returns:
a string representation of this throwable.


Generated on 8:41:50 AM June 06, 2005, © 1996-2005 Cafésoft LLC. All rights reserved.