com.lowagie.text
Class ExceptionConverter
RuntimeException
com.lowagie.text.ExceptionConverter
public class ExceptionConverter
extends RuntimeException
The ExceptionConverter changes a checked exception into an
unchecked exception.
private Exception | ex - we keep a handle to the wrapped exception
|
private String | prefix - prefix for the exception
|
private static long | serialVersionUID
|
Throwable | fillInStackTrace() - requests to fill in the stack trace we will have to ignore.
|
Exception | getException() - and allow the user of ExceptionConverter to get a handle to it.
|
String | getLocalizedMessage() - and make sure we also produce a localized version
|
String | getMessage() - We print the message of the checked exception
|
void | printStackTrace() - we have to override this as well
|
void | printStackTrace(java.io.PrintStream s) - here we prefix, with s.print(), not s.println(), the stack
trace with "ExceptionConverter:"
|
void | printStackTrace(java.io.PrintWriter s) - Again, we prefix the stack trace with "ExceptionConverter:"
|
String | toString() - The toString() is changed to be prefixed with ExceptionConverter
|
ex
private Exception ex
we keep a handle to the wrapped exception
prefix
private String prefix
prefix for the exception
serialVersionUID
private static final long serialVersionUID
ExceptionConverter
public ExceptionConverter(Exception ex)
Construct a RuntimeException based on another Exception
ex
- the exception that has to be turned into a RuntimeException
fillInStackTrace
public Throwable fillInStackTrace()
requests to fill in the stack trace we will have to ignore.
We can't throw an exception here, because this method
is called by the constructor of Throwable
getException
public Exception getException()
and allow the user of ExceptionConverter to get a handle to it.
getLocalizedMessage
public String getLocalizedMessage()
and make sure we also produce a localized version
- localized version of the message
getMessage
public String getMessage()
We print the message of the checked exception
- message of the original exception
printStackTrace
public void printStackTrace()
we have to override this as well
printStackTrace
public void printStackTrace(java.io.PrintStream s)
here we prefix, with s.print(), not s.println(), the stack
trace with "ExceptionConverter:"
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
Again, we prefix the stack trace with "ExceptionConverter:"
toString
public String toString()
The toString() is changed to be prefixed with ExceptionConverter
- Stringversion of the exception