Class 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.

    • Constructor Detail

      • ModifyPayloadExceptionHandler

        public ModifyPayloadExceptionHandler()
      • ModifyPayloadExceptionHandler

        public ModifyPayloadExceptionHandler​(java.lang.Boolean throwException)
    • Method Detail

      • 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).