public class InvocableHandlerMethod extends HandlerMethod
HandlerMethod
that invokes the underlying method with
argument values resolved from the current HTTP request through a list of
HandlerMethodArgumentResolver
.HandlerMethod.HandlerMethodParameter
Modifier and Type | Field and Description |
---|---|
private static <any> |
EMPTY_ARGS |
private static java.lang.Object |
NO_ARG_VALUE |
private ParameterNameDiscoverer |
parameterNameDiscoverer |
private ReactiveAdapterRegistry |
reactiveAdapterRegistry |
private HandlerMethodArgumentResolverComposite |
resolvers |
logger
Constructor and Description |
---|
InvocableHandlerMethod(HandlerMethod handlerMethod)
Create an instance from a
HandlerMethod . |
InvocableHandlerMethod(java.lang.Object bean,
java.lang.reflect.Method method)
Create an instance from a bean instance and a method.
|
Modifier and Type | Method and Description |
---|---|
private <any> |
getMethodArgumentValues(ServerWebExchange exchange,
BindingContext bindingContext,
java.lang.Object... providedArgs) |
ParameterNameDiscoverer |
getParameterNameDiscoverer()
Return the configured parameter name discoverer.
|
java.util.List<HandlerMethodArgumentResolver> |
getResolvers()
Return the configured argument resolvers.
|
<any> |
invoke(ServerWebExchange exchange,
BindingContext bindingContext,
java.lang.Object... providedArgs)
Invoke the method for the given exchange.
|
private static boolean |
isAsyncVoidReturnType(MethodParameter returnType,
ReactiveAdapter adapter) |
private boolean |
isResponseHandled(java.lang.Object[] args,
ServerWebExchange exchange) |
private void |
logArgumentErrorIfNecessary(ServerWebExchange exchange,
MethodParameter parameter,
java.lang.Throwable cause) |
void |
setArgumentResolvers(java.util.List<HandlerMethodArgumentResolver> resolvers)
Configure the argument resolvers to use to use for resolving method
argument values against a
ServerWebExchange . |
void |
setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer)
Set the ParameterNameDiscoverer for resolving parameter names when needed
(e.g.
|
void |
setReactiveAdapterRegistry(ReactiveAdapterRegistry registry)
Configure a reactive registry.
|
assertTargetBean, createWithResolvedBean, equals, findProvidedArgument, formatArgumentError, formatInvokeError, getBean, getBeanType, getBridgedMethod, getMethod, getMethodAnnotation, getMethodParameters, getResolvedFromHandlerMethod, getResponseStatus, getResponseStatusReason, getReturnType, getReturnValueType, getShortLogMessage, hashCode, hasMethodAnnotation, isVoid, toString
private static final <any> EMPTY_ARGS
private static final java.lang.Object NO_ARG_VALUE
private HandlerMethodArgumentResolverComposite resolvers
private ParameterNameDiscoverer parameterNameDiscoverer
private ReactiveAdapterRegistry reactiveAdapterRegistry
public InvocableHandlerMethod(HandlerMethod handlerMethod)
HandlerMethod
.public InvocableHandlerMethod(java.lang.Object bean, java.lang.reflect.Method method)
public void setArgumentResolvers(java.util.List<HandlerMethodArgumentResolver> resolvers)
ServerWebExchange
.public java.util.List<HandlerMethodArgumentResolver> getResolvers()
public void setParameterNameDiscoverer(ParameterNameDiscoverer nameDiscoverer)
Default is a DefaultParameterNameDiscoverer
.
public ParameterNameDiscoverer getParameterNameDiscoverer()
public void setReactiveAdapterRegistry(ReactiveAdapterRegistry registry)
By default this is an instance of ReactiveAdapterRegistry
with
default settings.
registry
- the registry to usepublic <any> invoke(ServerWebExchange exchange, BindingContext bindingContext, java.lang.Object... providedArgs)
exchange
- the current exchangebindingContext
- the binding context to useprovidedArgs
- optional list of argument values to match by typeHandlerResult
.private <any> getMethodArgumentValues(ServerWebExchange exchange, BindingContext bindingContext, java.lang.Object... providedArgs)
private void logArgumentErrorIfNecessary(ServerWebExchange exchange, MethodParameter parameter, java.lang.Throwable cause)
private static boolean isAsyncVoidReturnType(MethodParameter returnType, @Nullable ReactiveAdapter adapter)
private boolean isResponseHandled(java.lang.Object[] args, ServerWebExchange exchange)