Class RequestValidatorRequestBodyAdvice

java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
com.broadleafcommerce.cartoperation.web.advice.RequestValidatorRequestBodyAdvice
All Implemented Interfaces:
org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice

@ControllerAdvice public class RequestValidatorRequestBodyAdvice extends org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
Applies request validator validation to request bodies marked with a Validated annotation.
Author:
Jacob Mitash
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    afterBodyRead(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
     
    Finds compatible request validators for a given type.
    boolean
    supports(org.springframework.core.MethodParameter methodParameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
     

    Methods inherited from class org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter

    beforeBodyRead, handleEmptyBody

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice

    determineReadHints
  • Constructor Details

    • RequestValidatorRequestBodyAdvice

      public RequestValidatorRequestBodyAdvice(Set<RequestValidator> requestValidators)
  • Method Details

    • supports

      public boolean supports(@NonNull org.springframework.core.MethodParameter methodParameter, @NonNull Type targetType, @NonNull Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
    • afterBodyRead

      @NonNull public Object afterBodyRead(@NonNull Object body, @NonNull org.springframework.http.HttpInputMessage inputMessage, @NonNull org.springframework.core.MethodParameter parameter, @NonNull Type targetType, @NonNull Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
      Specified by:
      afterBodyRead in interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
      Overrides:
      afterBodyRead in class org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
    • findCompatibleValidators

      protected Set<RequestValidator> findCompatibleValidators(Class<?> clazz)
      Finds compatible request validators for a given type.
      Parameters:
      clazz - the type to test support of
      Returns:
      the compatible validators