public class ModifyPayloadExceptionHandler extends ValidationExceptionHandlerImpl
ValidationExceptionHandler
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.
log
Constructor and Description |
---|
ModifyPayloadExceptionHandler() |
ModifyPayloadExceptionHandler(java.lang.Boolean throwException) |
Modifier and Type | Method and 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.
|
public ModifyPayloadExceptionHandler()
public ModifyPayloadExceptionHandler(java.lang.Boolean throwException)
public void handle(org.everit.json.schema.ValidationException exc, AdaptrisMessage msg) throws ServiceException
ServiceException
public java.lang.Boolean getThrowException()
public void setThrowException(java.lang.Boolean b)
b
- true to throw an exception; false otherwise (default false).