public class PathVariableMethodArgumentResolver extends AbstractNamedValueMethodArgumentResolver
PathVariable.
An @PathVariable is a named value that gets resolved from a URI
template variable. It is always required and does not have a default value
to fall back on. See the base class
AbstractNamedValueMethodArgumentResolver
for more information on how named values are processed.
If the method parameter type is Map, the name specified in the
annotation is used to resolve the URI variable String value. The value is
then converted to a Map via type conversion, assuming a suitable
Converter.
PathVariableMapMethodArgumentResolverAbstractNamedValueMethodArgumentResolver.NamedValueInfo| Constructor and Description |
|---|
PathVariableMethodArgumentResolver(ConversionService conversionService,
ConfigurableBeanFactory beanFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected AbstractNamedValueMethodArgumentResolver.NamedValueInfo |
createNamedValueInfo(MethodParameter parameter)
Create the
AbstractNamedValueMethodArgumentResolver.NamedValueInfo object for the given method parameter. |
protected void |
handleMissingValue(String name,
MethodParameter parameter)
Invoked when a named value is required, but
AbstractNamedValueMethodArgumentResolver.resolveName(String, MethodParameter, ServerWebExchange) returned
null and there is no default value. |
protected void |
handleResolvedValue(Object arg,
String name,
MethodParameter parameter,
ModelMap model,
ServerWebExchange exchange)
Invoked after a value is resolved.
|
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) |
handleMissingValue, resolveArgumentpublic PathVariableMethodArgumentResolver(ConversionService conversionService, ConfigurableBeanFactory beanFactory)
public boolean supportsParameter(MethodParameter parameter)
protected AbstractNamedValueMethodArgumentResolver.NamedValueInfo createNamedValueInfo(MethodParameter parameter)
AbstractNamedValueMethodArgumentResolverAbstractNamedValueMethodArgumentResolver.NamedValueInfo object for the given method parameter.
Implementations typically retrieve the method annotation by means of
MethodParameter.getParameterAnnotation(Class).createNamedValueInfo in class AbstractNamedValueMethodArgumentResolverparameter - the method parameterprotected reactor.core.publisher.Mono<Object> resolveName(String name, MethodParameter parameter, ServerWebExchange exchange)
AbstractNamedValueMethodArgumentResolverresolveName in class AbstractNamedValueMethodArgumentResolvername - the name of the value being resolvedparameter - the method parameter to resolve to an argument value
(pre-nested in case of a Optional declaration)exchange - the current exchangenull)protected void handleMissingValue(String name, MethodParameter parameter)
AbstractNamedValueMethodArgumentResolverAbstractNamedValueMethodArgumentResolver.resolveName(String, MethodParameter, ServerWebExchange) returned
null and there is no default value. Subclasses typically throw an
exception in this case.handleMissingValue in class AbstractNamedValueMethodArgumentResolvername - the name for the valueparameter - the method parameterprotected void handleResolvedValue(Object arg, String name, MethodParameter parameter, ModelMap model, ServerWebExchange exchange)
AbstractNamedValueMethodArgumentResolverhandleResolvedValue in class AbstractNamedValueMethodArgumentResolverarg - the resolved argument valuename - the argument nameparameter - the argument parameter typemodel - the modelexchange - the current exchange