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 of
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.
-
Field Summary
Fields inherited from class com.adaptris.core.json.schema.ValidationExceptionHandlerImpl
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handle
(org.everit.json.schema.ValidationException exc, AdaptrisMessage msg) void
After adding the ValidationException to the payload throw an exception.
-
Constructor Details
-
ModifyPayloadExceptionHandler
public ModifyPayloadExceptionHandler() -
ModifyPayloadExceptionHandler
-
-
Method Details
-
handle
public void handle(org.everit.json.schema.ValidationException exc, AdaptrisMessage msg) throws ServiceException - Throws:
ServiceException
-
getThrowException
-
setThrowException
After adding the ValidationException to the payload throw an exception.- Parameters:
b
- true to throw an exception; false otherwise (default false).
-