org.jibx.ws.io.handler
Class ExceptionWriter
java.lang.Object
org.jibx.ws.io.handler.ExceptionWriter
- All Implemented Interfaces:
- OutHandler
public final class ExceptionWriter
- extends Object
- implements OutHandler
Writes an exception as an XML element.
Constructor Summary |
ExceptionWriter(Throwable t,
boolean includeStackTrace)
Writes an exception as an XML element, with an element name of <Exception>. |
Method Summary |
void |
invoke(OutContext context,
IXMLWriter xmlWriter)
Writes the throwable to the xmlWriter , wrapped in an <Exception> element. |
ExceptionWriter
public ExceptionWriter(Throwable t,
boolean includeStackTrace)
- Writes an exception as an XML element, with an element name of <Exception>.
- Parameters:
t
- the exception to writeincludeStackTrace
- true if a stack trace should be included in the XML.
invoke
public void invoke(OutContext context,
IXMLWriter xmlWriter)
throws IOException,
WsException
- Writes the throwable to the
xmlWriter
, wrapped in an <Exception> element.
Invokes the handler.
- Specified by:
invoke
in interface OutHandler
- Parameters:
context
- the context of the current message being sentxmlWriter
- a writer for the XML message positioned at the start of the XML content for which the handler is
configured
- Throws:
IOException
- on I/O error writing the XML content
WsException
- on errors other than I/O errors