@ControllerAdvice
public class VersionValidatingRequestBodyAdvice
extends org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
CartVersionedRequest
s. Will also populate the version on the request body object if the
version comes from something other than the request body (e.g. header, cookie).Constructor and Description |
---|
VersionValidatingRequestBodyAdvice(CartHolder<com.broadleafcommerce.cart.client.domain.Cart> requestCartHolder,
Set<CartVersionRequestValidator> validators,
RequestCartVersionResolver requestCartVersionResolver,
javax.servlet.http.HttpServletRequest request) |
Modifier and Type | Method and 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 javax.servlet.http.HttpServletRequest |
getRequest() |
protected CartHolder<com.broadleafcommerce.cart.client.domain.Cart> |
getRequestCartHolder() |
protected RequestCartVersionResolver |
getRequestCartVersionResolver() |
protected Set<CartVersionRequestValidator> |
getValidators() |
boolean |
supports(org.springframework.core.MethodParameter methodParameter,
Type targetType,
Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) |
public VersionValidatingRequestBodyAdvice(CartHolder<com.broadleafcommerce.cart.client.domain.Cart> requestCartHolder, Set<CartVersionRequestValidator> validators, RequestCartVersionResolver requestCartVersionResolver, javax.servlet.http.HttpServletRequest request)
public boolean supports(@NonNull org.springframework.core.MethodParameter methodParameter, @NonNull Type targetType, @NonNull Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
@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)
afterBodyRead
in interface org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
afterBodyRead
in class org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
protected CartHolder<com.broadleafcommerce.cart.client.domain.Cart> getRequestCartHolder()
protected Set<CartVersionRequestValidator> getValidators()
protected RequestCartVersionResolver getRequestCartVersionResolver()
protected javax.servlet.http.HttpServletRequest getRequest()
Copyright © 2021. All rights reserved.