|
spring-web | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.method.support.HandlerMethodReturnValueHandlerComposite
public class HandlerMethodReturnValueHandlerComposite
Handles method return values by delegating to a list of registered HandlerMethodReturnValueHandler
s.
Previously resolved return types are cached for faster lookups.
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
---|---|
HandlerMethodReturnValueHandlerComposite()
|
Method Summary | |
---|---|
HandlerMethodReturnValueHandlerComposite |
addHandler(HandlerMethodReturnValueHandler returnValuehandler)
Add the given HandlerMethodReturnValueHandler . |
HandlerMethodReturnValueHandlerComposite |
addHandlers(java.util.List<? extends HandlerMethodReturnValueHandler> returnValueHandlers)
Add the given HandlerMethodReturnValueHandler s. |
java.util.List<HandlerMethodReturnValueHandler> |
getHandlers()
Return a read-only list with the registered handlers, or an empty list. |
void |
handleReturnValue(java.lang.Object returnValue,
org.springframework.core.MethodParameter returnType,
ModelAndViewContainer mavContainer,
NativeWebRequest webRequest)
Iterate over registered HandlerMethodReturnValueHandler s and invoke the one that supports it. |
boolean |
supportsReturnType(org.springframework.core.MethodParameter returnType)
Whether the given method return type is supported by any registered HandlerMethodReturnValueHandler . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public HandlerMethodReturnValueHandlerComposite()
Method Detail |
---|
public java.util.List<HandlerMethodReturnValueHandler> getHandlers()
public boolean supportsReturnType(org.springframework.core.MethodParameter returnType)
HandlerMethodReturnValueHandler
.
supportsReturnType
in interface HandlerMethodReturnValueHandler
returnType
- the method return type to check
true
if this handler supports the supplied return type;
false
otherwisepublic void handleReturnValue(java.lang.Object returnValue, org.springframework.core.MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws java.lang.Exception
HandlerMethodReturnValueHandler
s and invoke the one that supports it.
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
mavContainer
- the ModelAndViewContainer for the current requestwebRequest
- the current request
java.lang.IllegalStateException
- if no suitable HandlerMethodReturnValueHandler
is found.
java.lang.Exception
- if the return value handling results in an errorpublic HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValuehandler)
HandlerMethodReturnValueHandler
.
public HandlerMethodReturnValueHandlerComposite addHandlers(java.util.List<? extends HandlerMethodReturnValueHandler> returnValueHandlers)
HandlerMethodReturnValueHandler
s.
|
spring-web | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |