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 RequestValidatorRequestBodyAdvice(Set<RequestValidator> requestValidators)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
afterBodyRead(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)
-
-
-
Constructor Detail
-
RequestValidatorRequestBodyAdvice
public RequestValidatorRequestBodyAdvice(Set<RequestValidator> requestValidators)
-
-
Method Detail
-
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 interfaceorg.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
- Overrides:
afterBodyRead
in classorg.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
-
-