Class ExceptionAsXml
java.lang.Object
com.adaptris.core.services.exception.ExceptionAsXml
- All Implemented Interfaces:
ExceptionSerializer
Use with
ExceptionReportService
to write the exception as part of an xml document.In the adapter configuration file this class is aliased as exception-as-xml which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
serialize
(Exception exception, AdaptrisMessage msg) Serialize the exception into the adaptris message.void
Specify how to merge the exception into the AdaptrisMessage.void
setExceptionGenerator
(ExceptionReportGenerator generator) Specify how to create the XML document from the exception.void
Whether or not to ignore exceptions parsing theAdaptrisMessage
.void
void
setXmlEncoding
(String encoding) Set the encoding for the resulting XML document.withDocumentMerge
(DocumentMerge docMerge)
-
Field Details
-
log
protected transient org.slf4j.Logger log
-
-
Constructor Details
-
ExceptionAsXml
public ExceptionAsXml()
-
-
Method Details
-
withDocumentMerge
-
withExceptionGenerator
-
withXmlEncoding
-
withDocumentFactoryConfig
-
withIgnoreXmlParseExceptions
-
serialize
Description copied from interface:ExceptionSerializer
Serialize the exception into the adaptris message.- Specified by:
serialize
in interfaceExceptionSerializer
- Parameters:
exception
- the exceptionmsg
- the message- Throws:
CoreException
- wrapping other exceptions.
-
getDocumentMerge
-
setDocumentMerge
Specify how to merge the exception into the AdaptrisMessage.- Parameters:
m
- the merge implementation, if not specified defaults toReplaceOriginal
-
getExceptionGenerator
-
setExceptionGenerator
Specify how to create the XML document from the exception.- Parameters:
generator
- the generator, if not specified defaults toSimpleExceptionReport
.
-
getXmlEncoding
-
setXmlEncoding
Set the encoding for the resulting XML document.- Parameters:
encoding
- the encoding, default is UTF-8
-
getXmlDocumentFactoryConfig
-
setXmlDocumentFactoryConfig
-
getIgnoreXmlParseExceptions
-
setIgnoreXmlParseExceptions
Whether or not to ignore exceptions parsing theAdaptrisMessage
.In some situations you might have an empty payload (such as when the workflow is fired by an HTTP GET request); but you want to report the exception as XML using
ReplaceOriginal
as theDocumentMerge
implementation. If that is the case, then you should set this value to be true. It defaults to false to preserve backwards compatibility.- Parameters:
b
- true to ignore parse exceptions (default is false if not specified.
-