Class SessionAttributeMethodArgumentResolver
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.SessionAttributeMethodArgumentResolver
- All Implemented Interfaces:
HandlerMethodArgumentResolver
Resolves method arguments annotated with an @
SessionAttribute
.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
- See Also:
-
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
ConstructorDescriptionSessionAttributeMethodArgumentResolver
(ConfigurableBeanFactory factory, ReactiveAdapterRegistry registry) -
Method Summary
Modifier and TypeMethodDescriptioncreateNamedValueInfo
(MethodParameter parameter) Create theAbstractNamedValueArgumentResolver.NamedValueInfo
object for the given method parameter.protected void
handleMissingValue
(String name, MethodParameter parameter) Invoked when a named value is required, butAbstractNamedValueArgumentResolver.resolveName(String, MethodParameter, ServerWebExchange)
returnednull
and there is no default value.protected reactor.core.publisher.Mono<Object>
resolveName
(String name, MethodParameter parameter, ServerWebExchange exchange) Resolve the given parameter type and value name into an argument value.boolean
supportsParameter
(MethodParameter parameter) Whether this resolver supports the given method parameter.Methods inherited from class org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver
handleMissingValue, handleResolvedValue, resolveArgument
Methods inherited from class org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
-
Constructor Details
-
SessionAttributeMethodArgumentResolver
public SessionAttributeMethodArgumentResolver(ConfigurableBeanFactory factory, ReactiveAdapterRegistry registry)
-
-
Method Details
-
supportsParameter
Description copied from interface:HandlerMethodArgumentResolver
Whether this resolver supports the given method parameter.- Parameters:
parameter
- the method parameter
-
createNamedValueInfo
protected AbstractNamedValueArgumentResolver.NamedValueInfo createNamedValueInfo(MethodParameter parameter) Description copied from class:AbstractNamedValueArgumentResolver
Create theAbstractNamedValueArgumentResolver.NamedValueInfo
object for the given method parameter. Implementations typically retrieve the method annotation by means ofMethodParameter.getParameterAnnotation(Class)
.- Specified by:
createNamedValueInfo
in classAbstractNamedValueArgumentResolver
- Parameters:
parameter
- the method parameter- Returns:
- the named value information
-
resolveName
protected reactor.core.publisher.Mono<Object> resolveName(String name, MethodParameter parameter, 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 resolvedparameter
- 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
)
-
handleMissingValue
Description copied from class:AbstractNamedValueArgumentResolver
Invoked when a named value is required, butAbstractNamedValueArgumentResolver.resolveName(String, MethodParameter, ServerWebExchange)
returnednull
and there is no default value. Subclasses typically throw an exception in this case.- Overrides:
handleMissingValue
in classAbstractNamedValueArgumentResolver
- Parameters:
name
- the name for the valueparameter
- the method parameter
-