Top Description Constructors Methods
org.springframework.web.reactive.result.method.annotation

public Class SessionAttributeMethodArgumentResolver

extends AbstractNamedValueArgumentResolver
Class Inheritance
Imports
reactor.core.publisher.Mono, org.springframework.beans.factory.config.ConfigurableBeanFactory, org.springframework.core.MethodParameter, .ReactiveAdapterRegistry, org.springframework.util.Assert, org.springframework.web.bind.annotation.SessionAttribute, .ValueConstants, org.springframework.web.server.MissingRequestValueException, .ServerWebExchange

Resolves method arguments annotated with an @SessionAttribute.
Author
Rossen Stoyanchev
Since
5.0
See Also
RequestAttributeMethodArgumentResolver

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected AbstractNamedValueArgumentResolver.NamedValueInfo
protected void
handleMissingValue(String
the name for the value
name
,
MethodParameter
the method parameter
parameter
)

Overrides org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.handleMissingValue.

Invoked when a named value is required, but resolveName(String, MethodParameter, ServerWebExchange) returned null and there is no default value.

protected Mono<Object>
resolveName(String
the name of the value being resolved
name
,
MethodParameter
the method parameter to resolve to an argument value (pre-nested in case of a java.util.Optional declaration)
parameter
,
ServerWebExchange
the current exchange
exchange
)

Implements abstract org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.resolveName.

Resolve the given parameter type and value name into an argument value.

public boolean
supportsParameter(MethodParameter
the method parameter
parameter
)

Implements org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver.supportsParameter.

Whether this resolver supports the given method parameter.

Inherited from org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver:
handleMissingValuehandleResolvedValueresolveArgument

Constructor Detail

SessionAttributeMethodArgumentResolverback to summary
public SessionAttributeMethodArgumentResolver(ConfigurableBeanFactory factory, ReactiveAdapterRegistry registry)

Method Detail

createNamedValueInfoback to summary
protected AbstractNamedValueArgumentResolver.NamedValueInfo createNamedValueInfo(MethodParameter parameter)

Implements abstract org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.createNamedValueInfo.

Doc from org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.createNamedValueInfo.

Create the NamedValueInfo object for the given method parameter. Implementations typically retrieve the method annotation by means of MethodParameter#getParameterAnnotation(Class).

Parameters
parameter:MethodParameter

the method parameter

Returns:AbstractNamedValueArgumentResolver.NamedValueInfo

the named value information

Annotations
@Override
handleMissingValueback to summary
protected void handleMissingValue(String name, MethodParameter parameter)

Overrides org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.handleMissingValue.

Doc from org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.handleMissingValue.

Invoked when a named value is required, but resolveName(String, MethodParameter, ServerWebExchange) returned null and there is no default value. Subclasses typically throw an exception in this case.

Parameters
name:String

the name for the value

parameter:MethodParameter

the method parameter

Annotations
@Override
resolveNameback to summary
protected Mono<Object> resolveName(String name, MethodParameter parameter, ServerWebExchange exchange)

Implements abstract org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.resolveName.

Doc from org.springframework.web.reactive.result.method.annotation.AbstractNamedValueArgumentResolver.resolveName.

Resolve the given parameter type and value name into an argument value.

Parameters
name:String

the name of the value being resolved

parameter:MethodParameter

the method parameter to resolve to an argument value (pre-nested in case of a java.util.Optional declaration)

exchange:ServerWebExchange

the current exchange

Returns:Mono<Object>

the resolved argument (may be empty Mono)

Annotations
@Override
supportsParameterback to summary
public boolean supportsParameter(MethodParameter parameter)

Implements org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver.supportsParameter.

Doc from org.springframework.web.reactive.result.method.HandlerMethodArgumentResolver.supportsParameter.

Whether this resolver supports the given method parameter.

Parameters
parameter:MethodParameter

the method parameter

Annotations
@Override