Class AbstractNamedValueMethodArgumentResolver

All Implemented Interfaces:
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.

Arjen Poutsma, Rossen Stoyanchev, Juergen Hoeller