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
-
Method Summary
Modifier and TypeMethodDescriptionafterBodyRead
(Object body, org.springframework.http.HttpInputMessage inputMessage, org.springframework.core.MethodParameter parameter, Type targetType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) protected Set<RequestValidator>
findCompatibleValidators
(Class<?> clazz) 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
-
Constructor Details
-
RequestValidatorRequestBodyAdvice
-
-
Method Details
-
supports
-
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 interfaceorg.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
- Overrides:
afterBodyRead
in classorg.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
-
findCompatibleValidators
Finds compatible request validators for a given type.- Parameters:
clazz
- the type to test support of- Returns:
- the compatible validators
-