Class ResponseBodyAdviceConfig
java.lang.Object
io.mosip.kernel.ridgenerator.config.ResponseBodyAdviceConfig
- All Implemented Interfaces:
org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<ResponseWrapper<?>>
@RestControllerAdvice
public class ResponseBodyAdviceConfig
extends Object
implements org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<ResponseWrapper<?>>
Configuration class to wrap the service response in
ResponseWrapper
and set the request attributes.- Since:
- 1.0.0
- Author:
- Sagar Mahapatra
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeBodyWrite(ResponseWrapper<?> body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response) booleansupports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType)
-
Constructor Details
-
ResponseBodyAdviceConfig
public ResponseBodyAdviceConfig()
-
-
Method Details
-
supports
public boolean supports(org.springframework.core.MethodParameter returnType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> converterType) - Specified by:
supportsin interfaceorg.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<ResponseWrapper<?>>
-
beforeBodyWrite
public ResponseWrapper<?> beforeBodyWrite(ResponseWrapper<?> body, org.springframework.core.MethodParameter returnType, org.springframework.http.MediaType selectedContentType, Class<? extends org.springframework.http.converter.HttpMessageConverter<?>> selectedConverterType, org.springframework.http.server.ServerHttpRequest request, org.springframework.http.server.ServerHttpResponse response) - Specified by:
beforeBodyWritein interfaceorg.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice<ResponseWrapper<?>>
-