Package com.adaptris.core.json.schema
Class ModifyPayloadExceptionHandler
- java.lang.Object
-
- com.adaptris.core.json.schema.ValidationExceptionHandlerImpl
-
- com.adaptris.core.json.schema.ModifyPayloadExceptionHandler
-
- All Implemented Interfaces:
ValidationExceptionHandler
@ComponentProfile(summary="Store schema violations as part of the JSON payload", tag="json,validation") public class ModifyPayloadExceptionHandler extends ValidationExceptionHandlerImpl
Implementation ofValidationExceptionHandler
that stores the violations as part of the payload.This implementation modifies the existing payload so that it is rewritten to be something like
{ "original" : { // the original message }, "schema-violations" : [ // list of validation failures ] }
In the adapter configuration file this class is aliased as json-schema-validation-exception-into-message which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.json.schema.ValidationExceptionHandlerImpl
log
-
-
Constructor Summary
Constructors Constructor Description ModifyPayloadExceptionHandler()
ModifyPayloadExceptionHandler(java.lang.Boolean throwException)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
getThrowException()
void
handle(org.everit.json.schema.ValidationException exc, AdaptrisMessage msg)
void
setThrowException(java.lang.Boolean b)
After adding the ValidationException to the payload throw an exception.
-
-
-
Method Detail
-
handle
public void handle(org.everit.json.schema.ValidationException exc, AdaptrisMessage msg) throws ServiceException
- Throws:
ServiceException
-
getThrowException
public java.lang.Boolean getThrowException()
-
setThrowException
public void setThrowException(java.lang.Boolean b)
After adding the ValidationException to the payload throw an exception.- Parameters:
b
- true to throw an exception; false otherwise (default false).
-
-