Top Description Fields Constructors Methods
org.springframework.messaging.handler.invocation.reactive

public Class HandlerMethodReturnValueHandlerComposite

extends Object
implements HandlerMethodReturnValueHandler
Class Inheritance
All Implemented Interfaces
org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler
Imports
java.util.ArrayList, .Collections, .List, org.apache.commons.logging.Log, .LogFactory, reactor.core.publisher.Mono, org.springframework.core.MethodParameter, org.springframework.lang.Nullable, org.springframework.messaging.Message

A HandlerMethodReturnValueHandler that wraps and delegates to others.
Author
Rossen Stoyanchev
Since
5.2

Field Summary

Modifier and TypeField and Description
protected final Log
private final List<HandlerMethodReturnValueHandler>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HandlerMethodReturnValueHandlerComposite
public HandlerMethodReturnValueHandlerComposite
public void
clear()

Clear the list of configured handlers.

private HandlerMethodReturnValueHandler
public List<HandlerMethodReturnValueHandler>
getReturnValueHandlers()

Return a read-only list with the configured handlers.

public Mono<Void>
handleReturnValue(Object
the value returned from the handler method
returnValue
,
MethodParameter
the type of the return value. This type must have previously been passed to supportsReturnType(MethodParameter) and it must have returned true.
returnType
,
Message<?> message)

Implements org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler.handleReturnValue.

Handle the given return value.

public boolean
supportsReturnType(MethodParameter
the method return type to check
returnType
)

Implements org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler.supportsReturnType.

Whether the given method return type is supported by this handler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

loggerback to summary
protected final Log logger
returnValueHandlersback to summary
private final List<HandlerMethodReturnValueHandler> returnValueHandlers

Constructor Detail

HandlerMethodReturnValueHandlerCompositeback to summary
public HandlerMethodReturnValueHandlerComposite()

Method Detail

addHandlerback to summary
public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValueHandler)

Add the given HandlerMethodReturnValueHandler.

addHandlersback to summary
public HandlerMethodReturnValueHandlerComposite addHandlers(List<? extends HandlerMethodReturnValueHandler> handlers)

Add the given HandlerMethodReturnValueHandlers.

clearback to summary
public void clear()

Clear the list of configured handlers.

getReturnValueHandlerback to summary
private HandlerMethodReturnValueHandler getReturnValueHandler(MethodParameter returnType)
Annotations
@SuppressWarnings:ForLoopReplaceableByForEach
@Nullable
getReturnValueHandlersback to summary
public List<HandlerMethodReturnValueHandler> getReturnValueHandlers()

Return a read-only list with the configured handlers.

handleReturnValueback to summary
public Mono<Void> handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message)

Implements org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler.handleReturnValue.

Doc from org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler.handleReturnValue.

Handle the given return value.

Parameters
returnValue:Object

the value returned from the handler method

returnType:MethodParameter

the type of the return value. This type must have previously been passed to supportsReturnType(MethodParameter) and it must have returned true.

Returns:Mono<Void>

Mono<Void> to indicate when handling is complete.

Annotations
@Override
supportsReturnTypeback to summary
public boolean supportsReturnType(MethodParameter returnType)

Implements org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler.supportsReturnType.

Doc from org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler.supportsReturnType.

Whether the given method return type is supported by this handler.

Parameters
returnType:MethodParameter

the method return type to check

Returns:boolean

true if this handler supports the supplied return type; false otherwise

Annotations
@Override