Class VersionValidatingRequestBodyAdvice
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
com.broadleafcommerce.paymenttransaction.web.advice.VersionValidatingRequestBodyAdvice
- All Implemented Interfaces:
org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdvice
@ControllerAdvice
public class VersionValidatingRequestBodyAdvice
extends org.springframework.web.servlet.mvc.method.annotation.RequestBodyAdviceAdapter
Request body advice which validates that the version is present for
VersionedRequest
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).- Author:
- Marie Standeven (mariestandeven)
-
Constructor Summary
ConstructorDescriptionVersionValidatingRequestBodyAdvice
(PaymentVersionValidationService paymentVersionValidationService, RequestVersionResolver requestVersionResolver, jakarta.servlet.http.HttpServletRequest request) -
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 PaymentVersionValidationService
protected jakarta.servlet.http.HttpServletRequest
protected RequestVersionResolver
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
-
VersionValidatingRequestBodyAdvice
public VersionValidatingRequestBodyAdvice(PaymentVersionValidationService paymentVersionValidationService, RequestVersionResolver requestVersionResolver, jakarta.servlet.http.HttpServletRequest request)
-
-
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
-
getPaymentVersionValidationService
-
getRequestVersionResolver
-
getRequest
protected jakarta.servlet.http.HttpServletRequest getRequest()
-