org.idoox.util
Class WrappedException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byorg.idoox.util.WrappedException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AdminServiceException, DeployException, DeploymentException, LookupException, MessageProcessingException, PackageException, PolicyException, PublishException, SchemaException, SequenceException, SignatureException, TokenizerException, TransportStartException, URLSerializationException, WaspInternalException, WebServiceLookupException, WSDL2JavaException

public class WrappedException
extends java.lang.Exception

This exception is able to contain another exception inside. It overrides useful methods such as printStackTrace to show stack trace of exception inside.

See Also:
Serialized Form
Component:
Core

Constructor Summary
WrappedException()
          Creates an exception.
WrappedException(java.lang.String message)
          Creates an exception.
WrappedException(java.lang.String message, java.lang.Throwable reason)
          Creates an exception.
WrappedException(java.lang.Throwable reason)
          Creates an exception.
 
Method Summary
 java.lang.Throwable getCause()
           
 java.lang.Throwable getException()
          Accesses the wrapped exception.
 java.lang.String getLocalizedMessage()
          Overloaded method from Throwable class replacing duplicite messages from wrapped exceptions by comparing the message do the message of reason exception and returning null in case of duplicity.
 java.lang.Throwable getRootException()
          Returns the originally wrapped exception in a sequence of wrappers.
 void printStackTrace()
          Prints stack trace to stderr.
 void printStackTrace(java.io.PrintStream p)
          Prints stack trace.
 void printStackTrace(java.io.PrintWriter p)
          Prints stack trace.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappedException

public WrappedException()
Creates an exception.


WrappedException

public WrappedException(java.lang.String message)
Creates an exception.

Parameters:
message - the message

WrappedException

public WrappedException(java.lang.String message,
                        java.lang.Throwable reason)
Creates an exception.

Parameters:
message - the message
reason - the wrapped exception

WrappedException

public WrappedException(java.lang.Throwable reason)
Creates an exception.

Parameters:
reason - the wrapped exception
Method Detail

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Overloaded method from Throwable class replacing duplicite messages from wrapped exceptions by comparing the message do the message of reason exception and returning null in case of duplicity.

Returns:
unique message or null

printStackTrace

public void printStackTrace()
Prints stack trace to stderr.


printStackTrace

public void printStackTrace(java.io.PrintStream p)
Prints stack trace.

Parameters:
p - the print stream where the error will be printed to

printStackTrace

public void printStackTrace(java.io.PrintWriter p)
Prints stack trace.

Parameters:
p - the print writer where the error will be printed to

getException

public java.lang.Throwable getException()
Accesses the wrapped exception.

Returns:
the wrapped exception

getRootException

public java.lang.Throwable getRootException()
Returns the originally wrapped exception in a sequence of wrappers.

Returns:
reason that is not an instance of WrappedException or null if such a reason has not been found.

getCause

public java.lang.Throwable getCause()