Class AbstractNamedValueSyncArgumentResolver
java.lang.Object
org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver
org.springframework.web.reactive.result.method.annotation.AbstractNamedValueSyncArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
,SyncHandlerMethodArgumentResolver
- Direct Known Subclasses:
CookieValueMethodArgumentResolver
,ExpressionValueMethodArgumentResolver
,MatrixVariableMethodArgumentResolver
,PathVariableMethodArgumentResolver
,RequestAttributeMethodArgumentResolver
,RequestHeaderMethodArgumentResolver
,RequestParamMethodArgumentResolver
public abstract class AbstractNamedValueSyncArgumentResolver
extends AbstractNamedValueArgumentResolver
implements SyncHandlerMethodArgumentResolver
An extension of
AbstractNamedValueArgumentResolver
for named value
resolvers that are synchronous and yet non-blocking. Subclasses implement
the synchronous resolveNamedValue(java.lang.String, org.springframework.core.MethodParameter, org.springframework.web.server.ServerWebExchange)
to which the asynchronous
resolveName(java.lang.String, org.springframework.core.MethodParameter, org.springframework.web.server.ServerWebExchange)
delegates to by default.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver
AbstractNamedValueArgumentResolver.NamedValueInfo
-
Field Summary
Fields inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
logger
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractNamedValueSyncArgumentResolver
(ConfigurableBeanFactory factory, ReactiveAdapterRegistry registry) Create a newAbstractNamedValueSyncArgumentResolver
. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Object>
resolveArgument
(MethodParameter parameter, BindingContext bindingContext, ServerWebExchange exchange) Resolve the value for the method parameter.resolveArgumentValue
(MethodParameter parameter, BindingContext context, ServerWebExchange exchange) Resolve the value for the method parameter synchronously.protected final reactor.core.publisher.Mono<Object>
resolveName
(String name, MethodParameter param, ServerWebExchange exchange) Resolve the given parameter type and value name into an argument value.protected abstract Object
resolveNamedValue
(String name, MethodParameter param, ServerWebExchange exchange) Actually resolve the value synchronously.Methods inherited from class org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver
createNamedValueInfo, handleMissingValue, handleMissingValue, handleResolvedValue
Methods inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver
supportsParameter
-
Constructor Details
-
AbstractNamedValueSyncArgumentResolver
protected AbstractNamedValueSyncArgumentResolver(@Nullable ConfigurableBeanFactory factory, ReactiveAdapterRegistry registry) Create a newAbstractNamedValueSyncArgumentResolver
.- Parameters:
factory
- a bean factory to use for resolving${...}
placeholder and#{...}
SpEL expressions in default values; ornull
if default values are not expected to have expressionsregistry
- for checking reactive type wrappers
-
-
Method Details
-
resolveArgument
public reactor.core.publisher.Mono<Object> resolveArgument(MethodParameter parameter, BindingContext bindingContext, ServerWebExchange exchange) Description copied from interface:HandlerMethodArgumentResolver
Resolve the value for the method parameter.- Specified by:
resolveArgument
in interfaceHandlerMethodArgumentResolver
- Specified by:
resolveArgument
in interfaceSyncHandlerMethodArgumentResolver
- Overrides:
resolveArgument
in classAbstractNamedValueArgumentResolver
- Parameters:
parameter
- the method parameterbindingContext
- the binding context to useexchange
- the current exchange- Returns:
Mono
for the argument value, possibly empty
-
resolveArgumentValue
public Object resolveArgumentValue(MethodParameter parameter, BindingContext context, ServerWebExchange exchange) Description copied from interface:SyncHandlerMethodArgumentResolver
Resolve the value for the method parameter synchronously.- Specified by:
resolveArgumentValue
in interfaceSyncHandlerMethodArgumentResolver
- Parameters:
parameter
- the method parametercontext
- the binding context to useexchange
- the current exchange- Returns:
- the resolved value, if any
-
resolveName
protected final reactor.core.publisher.Mono<Object> resolveName(String name, MethodParameter param, ServerWebExchange exchange) Description copied from class:AbstractNamedValueArgumentResolver
Resolve the given parameter type and value name into an argument value.- Specified by:
resolveName
in classAbstractNamedValueArgumentResolver
- Parameters:
name
- the name of the value being resolvedparam
- the method parameter to resolve to an argument value (pre-nested in case of aOptional
declaration)exchange
- the current exchange- Returns:
- the resolved argument (may be empty
Mono
)
-
resolveNamedValue
@Nullable protected abstract Object resolveNamedValue(String name, MethodParameter param, ServerWebExchange exchange) Actually resolve the value synchronously.
-