public class HandlerResult extends Object
Constructor and Description |
---|
HandlerResult(Object handler,
Object returnValue,
org.springframework.core.MethodParameter returnType)
Create a new
HandlerResult . |
HandlerResult(Object handler,
Object returnValue,
org.springframework.core.MethodParameter returnType,
org.springframework.ui.ModelMap model)
Create a new
HandlerResult . |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<HandlerResult> |
applyExceptionHandler(Throwable failure)
Apply the exception handler and return the alternative result.
|
Object |
getHandler()
Return the handler that handled the request.
|
org.springframework.ui.ModelMap |
getModel()
Return the model used during request handling with attributes that may be
used to render HTML templates with.
|
org.springframework.core.ResolvableType |
getReturnType()
Return the type of the value returned from the handler.
|
org.springframework.core.MethodParameter |
getReturnTypeSource()
Return the
MethodParameter from which
returnType was created. |
Optional<Object> |
getReturnValue()
Return the value returned from the handler wrapped as
Optional . |
boolean |
hasExceptionHandler()
Whether there is an exception handler.
|
HandlerResult |
setExceptionHandler(Function<Throwable,reactor.core.publisher.Mono<HandlerResult>> function)
Configure an exception handler that may be used to produce an alternative
result when result handling fails.
|
public HandlerResult(Object handler, Object returnValue, org.springframework.core.MethodParameter returnType)
HandlerResult
.handler
- the handler that handled the requestreturnValue
- the return value from the handler possibly null
returnType
- the return value typepublic HandlerResult(Object handler, Object returnValue, org.springframework.core.MethodParameter returnType, org.springframework.ui.ModelMap model)
HandlerResult
.handler
- the handler that handled the requestreturnValue
- the return value from the handler possibly null
returnType
- the return value typemodel
- the model used for request handlingpublic Object getHandler()
public Optional<Object> getReturnValue()
Optional
.public org.springframework.core.ResolvableType getReturnType()
public org.springframework.core.MethodParameter getReturnTypeSource()
MethodParameter
from which
returnType
was created.public org.springframework.ui.ModelMap getModel()
public HandlerResult setExceptionHandler(Function<Throwable,reactor.core.publisher.Mono<HandlerResult>> function)
function
- the error handlerpublic boolean hasExceptionHandler()
public reactor.core.publisher.Mono<HandlerResult> applyExceptionHandler(Throwable failure)
failure
- the exception