jodd.util
Class UncheckedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by jodd.util.UncheckedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BeanException, TypeConversionException

public class UncheckedException
extends java.lang.RuntimeException

Unchecked exception and also a wrapper for checked exceptions.

See Also:
Serialized Form

Field Summary
protected  java.lang.Throwable cause
           
static java.lang.String CAUSE_DIV
          Divider between causes printouts.
 boolean causeDetails
          If set to true stack trace will be enhanced with cause's stack traces.
 
Constructor Summary
UncheckedException()
           
UncheckedException(java.lang.String message)
           
UncheckedException(java.lang.String message, java.lang.Throwable t)
           
UncheckedException(java.lang.Throwable t)
           
 
Method Summary
 java.lang.Throwable getCause()
          Returns exception cause.
 java.lang.String getMessage()
          Returns the detail message, including the message from the nested exception if there is one.
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream ps)
           
 void printStackTrace(java.io.PrintWriter pw)
           
 void rethrow()
          Re-throws cause if exists.
static java.lang.RuntimeException wrap(java.lang.Throwable t)
          Wraps all exceptions in a UncheckedException
static java.lang.RuntimeException wrap(java.lang.Throwable t, java.lang.String message)
          Wraps all exceptions in a UncheckedException
static java.lang.RuntimeException wrapChecked(java.lang.Throwable t)
          Wraps checked exceptions in a UncheckedException.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cause

protected final java.lang.Throwable cause

CAUSE_DIV

public static java.lang.String CAUSE_DIV
Divider between causes printouts.


causeDetails

public boolean causeDetails
If set to true stack trace will be enhanced with cause's stack traces.

Constructor Detail

UncheckedException

public UncheckedException(java.lang.Throwable t)

UncheckedException

public UncheckedException()

UncheckedException

public UncheckedException(java.lang.String message)

UncheckedException

public UncheckedException(java.lang.String message,
                          java.lang.Throwable t)
Method Detail

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream ps)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter pw)
Overrides:
printStackTrace in class java.lang.Throwable

getMessage

public java.lang.String getMessage()
Returns the detail message, including the message from the nested exception if there is one.

Overrides:
getMessage in class java.lang.Throwable

wrapChecked

public static java.lang.RuntimeException wrapChecked(java.lang.Throwable t)
Wraps checked exceptions in a UncheckedException. Unchecked exceptions are not wrapped.


wrap

public static java.lang.RuntimeException wrap(java.lang.Throwable t)
Wraps all exceptions in a UncheckedException


wrap

public static java.lang.RuntimeException wrap(java.lang.Throwable t,
                                              java.lang.String message)
Wraps all exceptions in a UncheckedException


rethrow

public void rethrow()
             throws java.lang.Throwable
Re-throws cause if exists.

Throws:
java.lang.Throwable

getCause

public java.lang.Throwable getCause()
Returns exception cause.

Overrides:
getCause in class java.lang.Throwable


Copyright ©2008 Jodd Team