public class HandlerMethodReturnValueHandlerComposite extends Object implements HandlerMethodReturnValueHandler
Constructor and Description |
---|
HandlerMethodReturnValueHandlerComposite() |
Modifier and Type | Method and Description |
---|---|
HandlerMethodReturnValueHandlerComposite |
addHandler(HandlerMethodReturnValueHandler returnValuehandler)
Add the given
HandlerMethodReturnValueHandler . |
HandlerMethodReturnValueHandlerComposite |
addHandlers(List<? extends HandlerMethodReturnValueHandler> handlers)
Add the given
HandlerMethodReturnValueHandler s. |
void |
clear()
Clear the list of configured handlers.
|
List<HandlerMethodReturnValueHandler> |
getReturnValueHandlers()
Return a read-only list with the configured handlers.
|
void |
handleReturnValue(Object returnValue,
MethodParameter returnType,
Message<?> message)
Handle the given return value.
|
boolean |
supportsReturnType(MethodParameter returnType)
Whether the given method return type is
supported by this handler.
|
public HandlerMethodReturnValueHandlerComposite()
public List<HandlerMethodReturnValueHandler> getReturnValueHandlers()
public void clear()
public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValuehandler)
HandlerMethodReturnValueHandler
.public HandlerMethodReturnValueHandlerComposite addHandlers(List<? extends HandlerMethodReturnValueHandler> handlers)
HandlerMethodReturnValueHandler
s.public boolean supportsReturnType(MethodParameter returnType)
HandlerMethodReturnValueHandler
supportsReturnType
in interface HandlerMethodReturnValueHandler
returnType
- the method return type to checktrue
if this handler supports the supplied return type;
false
otherwisepublic void handleReturnValue(Object returnValue, MethodParameter returnType, Message<?> message) throws Exception
HandlerMethodReturnValueHandler
handleReturnValue
in interface HandlerMethodReturnValueHandler
returnValue
- the value returned from the handler methodreturnType
- the type of the return value. This type must have
previously been passed to
HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
and it must have returned true
message
- the message that caused this method to be calledException
- if the return value handling results in an error