org.htmlparser.util

Class ChainedException

Known Direct Subclasses:
ParserException

public class ChainedException
extends Exception

Support for chained exceptions in code that predates Java 1.4. A chained exception can use a Throwable argument to reference a lower level exception. The chained exception provides a stack trace that includes the message and any throwable exception included as an argument in the chain. For example: ApplicationException: Application problem encountered; ProcessException: Unable to process document; java.io.IOException: Unable to open 'filename.ext' at ChainedExceptionTest.openFile(ChainedExceptionTest.java:19) at ChainedExceptionTest.processFile(ChainedExceptionTest.java:27) at ChainedExceptionTest.application(ChainedExceptionTest.java:40) at ChainedExceptionTest.main(ChainedExceptionTest.java:52) Represents the output from two nested exceptions. The outside exception is a subclass of ChainedException called ApplicationException, which includes a throwable reference. The throwable reference is also a subclass of ChainedException, called ProcessException, which in turn includes a reference to a standard IOException. In each case, the message is increasingly specific about the nature of the problem. The end user may only see the application exception, but debugging is greatly enhanced by having more details in the stack trace.
Author:
Claude Duguay

Field Summary

protected Throwable
throwable

Constructor Summary

ChainedException()
ChainedException(String message)
ChainedException(String message, Throwable throwable)
ChainedException(Throwable throwable)

Method Summary

String[]
getMessageChain()
Vector
getMessageList()
Throwable
getThrowable()
void
printStackTrace()
void
printStackTrace(PrintStream out)
void
printStackTrace(PrintWriter out)

Field Details

throwable

protected Throwable throwable

Constructor Details

ChainedException

public ChainedException()

ChainedException

public ChainedException(String message)

ChainedException

public ChainedException(String message,
                        Throwable throwable)

ChainedException

public ChainedException(Throwable throwable)

Method Details

getMessageChain

public String[] getMessageChain()

getMessageList

public Vector getMessageList()

getThrowable

public Throwable getThrowable()

printStackTrace

public void printStackTrace()

printStackTrace

public void printStackTrace(PrintStream out)

printStackTrace

public void printStackTrace(PrintWriter out)

HTML Parser is an open source library released under LGPL. SourceForge.net