Class ValidatingInterceptor

java.lang.Object
io.fluxzero.sdk.tracking.handling.validation.ValidatingInterceptor
All Implemented Interfaces:
HandlerDecorator, HandlerInterceptor

public class ValidatingInterceptor extends Object implements HandlerInterceptor
A HandlerInterceptor that validates the payload of messages before they are handled. When the supplied validator supports contextual method constraints, the current message context can be used to resolve constrained method parameters.
  • Constructor Details

    • ValidatingInterceptor

      public ValidatingInterceptor()
      Creates an interceptor backed by the default validator.
    • ValidatingInterceptor

      public ValidatingInterceptor(Validator validator)
      Creates an interceptor backed by the supplied validator.
      Parameters:
      validator - the validator to use for payload and return value validation
    • ValidatingInterceptor

      public ValidatingInterceptor(Validator validator, boolean validatePayload)
      Creates an interceptor backed by the supplied validator.
      Parameters:
      validator - the validator to use for validation
      validatePayload - whether incoming message payloads should be validated before handler invocation
  • Method Details