at.gv.egovernment.moa.spss
Class MOAException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--at.gv.egovernment.moa.spss.MOAException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MOAApplicationException, MOASystemException

public abstract class MOAException
extends Exception

Base class of MOA specific exceptions. This class has the ability to wrap other exceptions which may be seen as the root cause for this exception. A similar mechanism is in place since JDK1.4 (see the getClause() method) but will not be used because of required compatibility with JDK1.3.

Version:
$Id$
Author:
Patrick Peck
See Also:
Serialized Form

Constructor Summary
MOAException(String messageId, Object[] parameters)
          Create a MOAException.
MOAException(String messageId, Object[] parameters, Throwable wrapped)
          Create a MOAException.
 
Method Summary
 String getMessageId()
          Returns the message ID of this exception.
 Throwable getWrapped()
          Returns the exception wrapped by this MOAException.
 void printStackTrace()
          Print a stack trace of this exception to System.err.
 void printStackTrace(PrintStream s)
          Print a stack trace of this exception, including the wrapped exception.
 void printStackTrace(PrintWriter s)
          Print a stack trace of this exception, including the wrapped exception.
 org.w3c.dom.Element toErrorResponse()
          Convert this MOAException to an ErrorResponse element from the MOA namespace.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MOAException

public MOAException(String messageId,
                    Object[] parameters)
Create a MOAException.
Parameters:
messageId - The message ID of the message contained in the created MOAException.
parameters - The parameters needed to fill in the message arguments.

MOAException

public MOAException(String messageId,
                    Object[] parameters,
                    Throwable wrapped)
Create a MOAException.
Parameters:
messageId - The message ID of the message contained in the created MOAException.
parameters - The parameters needed to fill in the message arguments.
wrapped - The exception wrapped by the created MOAException.
Method Detail

getMessageId

public String getMessageId()
Returns the message ID of this exception.
Returns:
The message ID as provided in the constructor.

getWrapped

public Throwable getWrapped()
Returns the exception wrapped by this MOAException.
Returns:
The exception wrapped by this exception. Possibly null, if none was provided at construction time.

toErrorResponse

public org.w3c.dom.Element toErrorResponse()
Convert this MOAException to an ErrorResponse element from the MOA namespace.
Returns:
An ErrorResponse element, containing the subelements ErrorCode and Info required by the MOA schema.

printStackTrace

public void printStackTrace()
Print a stack trace of this exception to System.err.
Overrides:
printStackTrace in class Throwable
See Also:
Throwable.printStackTrace()

printStackTrace

public void printStackTrace(PrintStream s)
Print a stack trace of this exception, including the wrapped exception.
Overrides:
printStackTrace in class Throwable
Parameters:
s - The stream to write the stack trace to.
See Also:
Throwable.printStackTrace(java.io.PrintStream)

printStackTrace

public void printStackTrace(PrintWriter s)
Print a stack trace of this exception, including the wrapped exception.
Overrides:
printStackTrace in class Throwable
Parameters:
s - The stream to write the stacktrace to.
See Also:
Throwable.printStackTrace(java.io.PrintWriter)