org.enhydra.error
Class ChainedError

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Error
              |
              +--org.enhydra.error.ChainedError
All Implemented Interfaces:
ChainedThrowable, Serializable
Direct Known Subclasses:
DOMError, FatalExceptionError, LazyDOMError, XMLCError, XMLIOError

public class ChainedError
extends Error
implements ChainedThrowable

Error used as a base for creating an error that has a chain of exceptions that lead to the derived error. Very useful for interfaces where the implementation exception is not known.

See Also:
Serialized Form

Constructor Summary
protected ChainedError(String msg)
          Construct an error without a specified cause.
protected ChainedError(String msg, Throwable cause)
          Construct an exception with an associated causing exception.
protected ChainedError(Throwable cause)
          Construct an exception from a causing exception.
 
Method Summary
 Throwable getCause()
          Get the causing exception associated with this exception.
 String getLocalizedMessage()
          Creates a localized description of this exception.
 String getMessage()
          Return the message associated with this exception.
 void printStackTrace()
          Prints this exception and its backtrace, and the causes and their stack traces to the standard error stream.
 void printStackTrace(PrintStream s)
          Prints this exception and its backtrace, and the causes and their stack traces to the e specified print stream.
 void printStackTrace(PrintWriter s)
          Prints this exception and its backtrace, and the causes and their stack traces to the e specified print writer.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChainedError

protected ChainedError(String msg)
Construct an error without a specified cause.
Parameters:
msg - The message associated with the exception.

ChainedError

protected ChainedError(String msg,
                       Throwable cause)
Construct an exception with an associated causing exception.
Parameters:
msg - The message associated with the exception.
cause - The error or exception that cause this exception.

ChainedError

protected ChainedError(Throwable cause)
Construct an exception from a causing exception.
Parameters:
cause - The error or exception that cause this exception. The message will be take be this object's messasge.
Method Detail

getMessage

public String getMessage()
Return the message associated with this exception. If causes are included, they will be appended to the message.
Specified by:
getMessage in interface ChainedThrowable
Overrides:
getMessage in class Throwable

getLocalizedMessage

public String getLocalizedMessage()
Creates a localized description of this exception.
Specified by:
getLocalizedMessage in interface ChainedThrowable
Overrides:
getLocalizedMessage in class Throwable

getCause

public Throwable getCause()
Get the causing exception associated with this exception.
Specified by:
getCause in interface ChainedThrowable
Returns:
The causing exception or null if no cause is specified.

printStackTrace

public void printStackTrace()
Prints this exception and its backtrace, and the causes and their stack traces to the standard error stream.
Specified by:
printStackTrace in interface ChainedThrowable
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
Prints this exception and its backtrace, and the causes and their stack traces to the e specified print stream.
Specified by:
printStackTrace in interface ChainedThrowable
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter s)
Prints this exception and its backtrace, and the causes and their stack traces to the e specified print writer.
Specified by:
printStackTrace in interface ChainedThrowable
Overrides:
printStackTrace in class Throwable


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.