类 AbstractMessageWriterResultHandler
- java.lang.Object
- org.springframework.web.reactive.result.HandlerResultHandlerSupport
- org.springframework.web.reactive.result.method.annotation.AbstractMessageWriterResultHandler
- 所有已实现的接口:
Ordered
public abstract class AbstractMessageWriterResultHandler extends HandlerResultHandlerSupport
Abstract base class for result handlers that handle return values by writing to the response withHttpMessageWriter.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Sebastien Deleuze
字段概要
从类继承的字段 org.springframework.web.reactive.result.HandlerResultHandlerSupport
logger
从接口继承的字段 org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
构造器概要
构造器 限定符 构造器 说明 protectedAbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver)Constructor withHttpMessageWritersand aRequestedContentTypeResolver.protectedAbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry)Constructor with an additionalReactiveAdapterRegistry.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 List<HttpMessageWriter<?>>getMessageWriters()Return the configured message converters.protected reactor.core.publisher.Mono<Void>writeBody(Object body, MethodParameter bodyParameter, MethodParameter actualParam, ServerWebExchange exchange)Write a given body to the response withHttpMessageWriter.protected reactor.core.publisher.Mono<Void>writeBody(Object body, MethodParameter bodyParameter, ServerWebExchange exchange)Write a given body to the response withHttpMessageWriter.从类继承的方法 org.springframework.web.reactive.result.HandlerResultHandlerSupport
getAdapter, getAdapterRegistry, getContentTypeResolver, getOrder, selectMediaType, setOrder
构造器详细资料
AbstractMessageWriterResultHandler
protected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver)
Constructor withHttpMessageWritersand aRequestedContentTypeResolver.- 参数:
messageWriters- for serializing Objects to the response body streamcontentTypeResolver- for resolving the requested content type
AbstractMessageWriterResultHandler
protected AbstractMessageWriterResultHandler(List<HttpMessageWriter<?>> messageWriters, RequestedContentTypeResolver contentTypeResolver, ReactiveAdapterRegistry adapterRegistry)
Constructor with an additionalReactiveAdapterRegistry.- 参数:
messageWriters- for serializing Objects to the response body streamcontentTypeResolver- for resolving the requested content typeadapterRegistry- for adapting other reactive types (e.g. rx.Observable, rx.Single, etc.) to Flux or Mono
方法详细资料
getMessageWriters
public List<HttpMessageWriter<?>> getMessageWriters()
Return the configured message converters.
writeBody
protected reactor.core.publisher.Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParameter, ServerWebExchange exchange)
Write a given body to the response withHttpMessageWriter.- 参数:
body- the object to writebodyParameter- theMethodParameterof the body to writeexchange- the current exchange- 返回:
- indicates completion or error
- 另请参阅:
writeBody(Object, MethodParameter, MethodParameter, ServerWebExchange)
writeBody
protected reactor.core.publisher.Mono<Void> writeBody(@Nullable Object body, MethodParameter bodyParameter, @Nullable MethodParameter actualParam, ServerWebExchange exchange)
Write a given body to the response withHttpMessageWriter.- 参数:
body- the object to writebodyParameter- theMethodParameterof the body to writeactualParam- the actual return type of the method that returned the value; could be different frombodyParameterwhen processingHttpEntityfor exampleexchange- the current exchange- 返回:
- indicates completion or error
- 从以下版本开始:
- 5.0.2