类 ModelAttributeMethodArgumentResolver
- java.lang.Object
- org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
- org.springframework.web.reactive.result.method.annotation.ModelAttributeMethodArgumentResolver
- 所有已实现的接口:
HandlerMethodArgumentResolver
public class ModelAttributeMethodArgumentResolver extends HandlerMethodArgumentResolverSupport
Resolve@ModelAttribute
annotated method arguments.Model attributes are sourced from the model, or created using a default constructor and then added to the model. Once created the attribute is populated via data binding to the request (form data, query params). Validation also may be applied if the argument is annotated with
@javax.validation.Valid
or Spring's own@org.springframework.validation.annotation.Validated
.When this handler is created with
useDefaultResolution=true
any non-simple type argument and return value is regarded as a model attribute with or without the presence of an@ModelAttribute
.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Juergen Hoeller
字段概要
从类继承的字段 org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
logger
构造器概要
构造器 构造器 说明 ModelAttributeMethodArgumentResolver(ReactiveAdapterRegistry adapterRegistry, boolean useDefaultResolution)
Class constructor with a default resolution mode flag.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected reactor.core.publisher.Mono<Void>
bindRequestParameters(WebExchangeDataBinder binder, ServerWebExchange exchange)
Extension point to bind the request to the target object.reactor.core.publisher.Mono<Object>
resolveArgument(MethodParameter parameter, BindingContext context, ServerWebExchange exchange)
Resolve the value for the method parameter.boolean
supportsParameter(MethodParameter parameter)
Whether this resolver supports the given method parameter.从类继承的方法 org.springframework.web.reactive.result.method.HandlerMethodArgumentResolverSupport
checkAnnotatedParamNoReactiveWrapper, checkParameterType, checkParameterTypeNoReactiveWrapper, getAdapterRegistry
构造器详细资料
ModelAttributeMethodArgumentResolver
public ModelAttributeMethodArgumentResolver(ReactiveAdapterRegistry adapterRegistry, boolean useDefaultResolution)
Class constructor with a default resolution mode flag.- 参数:
adapterRegistry
- for adapting to other reactive types from and to MonouseDefaultResolution
- if "true", non-simple method arguments and return values are considered model attributes with or without a@ModelAttribute
annotation present.
方法详细资料
supportsParameter
public boolean supportsParameter(MethodParameter parameter)
从接口复制的说明:HandlerMethodArgumentResolver
Whether this resolver supports the given method parameter.- 参数:
parameter
- the method parameter
resolveArgument
public reactor.core.publisher.Mono<Object> resolveArgument(MethodParameter parameter, BindingContext context, ServerWebExchange exchange)
从接口复制的说明:HandlerMethodArgumentResolver
Resolve the value for the method parameter.- 参数:
parameter
- the method parametercontext
- the binding context to useexchange
- the current exchange- 返回:
Mono
for the argument value, possibly empty
bindRequestParameters
protected reactor.core.publisher.Mono<Void> bindRequestParameters(WebExchangeDataBinder binder, ServerWebExchange exchange)
Extension point to bind the request to the target object.- 参数:
binder
- the data binder instance to use for the bindingexchange
- the current request- 从以下版本开始:
- 5.2.6