com.lowagie.text
Class ExceptionConverter

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.lowagie.text.ExceptionConverter
All Implemented Interfaces:
Serializable

public class ExceptionConverter
extends RuntimeException

The ExceptionConverter changes a checked exception into an unchecked exception.

See Also:
Serialized Form

Field Summary
private  Exception ex
          we keep a handle to the wrapped exception
 
Fields inherited from class java.lang.RuntimeException
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
ExceptionConverter(Exception ex)
           
 
Method Summary
 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(PrintStream s)
          here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"
 void printStackTrace(PrintWriter s)
          Again, we prefix the stack trace with "ExceptionConverter:"
 String toString()
          The toString() is changed to be prefixed with ExceptionConverter
 
Methods inherited from class java.lang.Throwable
getCause, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ex

private Exception ex
we keep a handle to the wrapped exception

Constructor Detail

ExceptionConverter

public ExceptionConverter(Exception ex)
Method Detail

getException

public Exception getException()
and allow the user of ExceptionConverter to get a handle to it.


getMessage

public String getMessage()
We print the message of the checked exception

Overrides:
getMessage in class Throwable

getLocalizedMessage

public String getLocalizedMessage()
and make sure we also produce a localized version

Overrides:
getLocalizedMessage in class Throwable

toString

public String toString()
The toString() is changed to be prefixed with ExceptionConverter

Overrides:
toString in class Throwable

printStackTrace

public void printStackTrace()
we have to override this as well

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
here we prefix, with s.print(), not s.println(), the stack trace with "ExceptionConverter:"

Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter s)
Again, we prefix the stack trace with "ExceptionConverter:"

Overrides:
printStackTrace in class Throwable

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

Overrides:
fillInStackTrace in class Throwable