public class ResourceProcessorHandlerMethodReturnValueHandler extends Object implements HandlerMethodReturnValueHandler
HandlerMethodReturnValueHandler
to post-process the objects returned from controller methods using the
configured ResourceProcessor
s.Constructor and Description |
---|
ResourceProcessorHandlerMethodReturnValueHandler(HandlerMethodReturnValueHandler delegate,
List<org.springframework.hateoas.ResourceProcessor<?>> processors)
Creates a new
ResourceProcessorHandlerMethodReturnValueHandler using the given delegate to eventually
delegate calls to handleReturnValue(Object, MethodParameter, ModelAndViewContainer, NativeWebRequest) to. |
Modifier and Type | Method and Description |
---|---|
void |
handleReturnValue(Object returnValue,
MethodParameter returnType,
ModelAndViewContainer mavContainer,
NativeWebRequest webRequest) |
void |
setRootLinksAsHeaders(boolean rootLinksAsHeaders) |
boolean |
supportsReturnType(MethodParameter returnType) |
public ResourceProcessorHandlerMethodReturnValueHandler(HandlerMethodReturnValueHandler delegate, List<org.springframework.hateoas.ResourceProcessor<?>> processors)
ResourceProcessorHandlerMethodReturnValueHandler
using the given delegate to eventually
delegate calls to handleReturnValue(Object, MethodParameter, ModelAndViewContainer, NativeWebRequest)
to.
Will consider the given ResourceProcessor
to post-process the controller methods return value to before
invoking the delegate.delegate
- the HandlerMethodReturnValueHandler
to evenually delegate calls to, must not be
null.processors
- the ResourceProcessor
s to be considered, must not be null.public void setRootLinksAsHeaders(boolean rootLinksAsHeaders)
rootLinksAsHeaders
- the rootLinksAsHeaders to setpublic boolean supportsReturnType(MethodParameter returnType)
supportsReturnType
in interface HandlerMethodReturnValueHandler
public void handleReturnValue(Object returnValue, MethodParameter returnType, ModelAndViewContainer mavContainer, NativeWebRequest webRequest) throws Exception
handleReturnValue
in interface HandlerMethodReturnValueHandler
Exception
Copyright © 2011-2015–2016 Pivotal Software, Inc.. All rights reserved.