Package org.springframework.web.servlet.mvc.method.annotation

# 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:

- `HttpEntityMethodProcessor` for responses with a concrete body value
- `ResponseBodyEmitterReturnValueHandler` for responses with a body that is a `ResponseBodyEmitter` or an async/reactive type.

Use of this wrapper allows for late check in `handleReturnValue(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest)` of the type of the actual body value in case the method signature does not provide enough information to decide via `supportsReturnType(org.springframework.core.MethodParameter)`.

Since:
  6.2.9
Author:
  Rossen Stoyanchev

## Constructor Summary

Constructors
Constructor
Description
`ResponseEntityReturnValueHandler(HttpEntityMethodProcessor httpEntityMethodProcessor, ResponseBodyEmitterReturnValueHandler responseBodyEmitterHandler)`

## Method Summary

Modifier and Type
Method
Description
`void`
`handleReturnValue(Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.web.method.support.ModelAndViewContainer mavContainer, org.springframework.web.context.request.NativeWebRequest request)`
`boolean`
`supportsReturnType(org.springframework.core.MethodParameter returnType)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ResponseEntityReturnValueHandler

public ResponseEntityReturnValueHandler(HttpEntityMethodProcessor httpEntityMethodProcessor, ResponseBodyEmitterReturnValueHandler responseBodyEmitterHandler)

## Method Details

### supportsReturnType

public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)

Specified by:
  `supportsReturnType` in interface `org.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:
  `handleReturnValue` in interface `org.springframework.web.method.support.HandlerMethodReturnValueHandler`
Throws:
  `Exception`