Class ResponseEntityReturnValueHandler
java.lang.Object
org.springframework.web.servlet.mvc.method.annotation.ResponseEntityReturnValueHandler
- All Implemented Interfaces:
org.springframework.web.method.support.HandlerMethodReturnValueHandler
public class ResponseEntityReturnValueHandler
extends Object
implements org.springframework.web.method.support.HandlerMethodReturnValueHandler
Handler for return values of type
ResponseEntity
that delegates to one of the following:
HttpEntityMethodProcessorfor responses with a concrete body valueResponseBodyEmitterReturnValueHandlerfor responses with a body that is aResponseBodyEmitteror an async/reactive type.
Use of this wrapper allows for late check in handleReturnValue(Object, MethodParameter, ModelAndViewContainer, NativeWebRequest) of
the type of the actual body value in case the method signature does not
provide enough information to decide via supportsReturnType(MethodParameter).
- Since:
- 6.2.9
- Author:
- Rossen Stoyanchev
-
Constructor Summary
ConstructorsConstructorDescriptionResponseEntityReturnValueHandler(HttpEntityMethodProcessor httpEntityMethodProcessor, ResponseBodyEmitterReturnValueHandler responseBodyEmitterHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleReturnValue(@Nullable Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest request) booleansupportsReturnType(org.springframework.core.MethodParameter returnType)
-
Constructor Details
-
ResponseEntityReturnValueHandler
public ResponseEntityReturnValueHandler(HttpEntityMethodProcessor httpEntityMethodProcessor, ResponseBodyEmitterReturnValueHandler responseBodyEmitterHandler)
-
-
Method Details
-
supportsReturnType
public boolean supportsReturnType(org.springframework.core.MethodParameter returnType) - Specified by:
supportsReturnTypein interfaceorg.springframework.web.method.support.HandlerMethodReturnValueHandler
-
handleReturnValue
public void handleReturnValue(@Nullable Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest request) throws Exception - Specified by:
handleReturnValuein interfaceorg.springframework.web.method.support.HandlerMethodReturnValueHandler- Throws:
Exception
-