Class AbstractNamedValueMethodArgumentResolver

java.lang.Object
org.springframework.web.method.annotation.AbstractNamedValueMethodArgumentResolver
All Implemented Interfaces:
HandlerMethodArgumentResolver
Direct Known Subclasses:
AbstractCookieValueMethodArgumentResolver, ExpressionValueMethodArgumentResolver, MatrixVariableMethodArgumentResolver, PathVariableMethodArgumentResolver, RequestAttributeMethodArgumentResolver, RequestHeaderMethodArgumentResolver, RequestParamMethodArgumentResolver, SessionAttributeMethodArgumentResolver

public abstract class AbstractNamedValueMethodArgumentResolver extends Object implements HandlerMethodArgumentResolver
Abstract base class for resolving method arguments from a named value. Request parameters, request headers, and path variables are examples of named values. Each may have a name, a required flag, and a default value.

Subclasses define how to do the following:

  • Obtain named value information for a method parameter
  • Resolve names into argument values
  • Handle missing argument values when argument values are required
  • Optionally handle a resolved value

A default value string can contain ${...} placeholders and Spring Expression Language #{...} expressions. For this to work a ConfigurableBeanFactory must be supplied to the class constructor.

A WebDataBinder is created to apply type conversion to the resolved argument value if it doesn't match the method parameter type.

Since:
3.1
Author:
Arjen Poutsma, Rossen Stoyanchev, Juergen Hoeller, Sebastien Deleuze