类 AbstractNamedValueMethodArgumentResolver

  • 所有已实现的接口:
    HandlerMethodArgumentResolver
    直接已知子类:
    DestinationVariableMethodArgumentResolver, HeaderMethodArgumentResolver

    public abstract class AbstractNamedValueMethodArgumentResolver
    extends Object
    implements HandlerMethodArgumentResolver
    Abstract base class for resolving method arguments from a named value. Message 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 ConversionService may be used to apply type conversion to the resolved argument value if it doesn't match the method parameter type.

    从以下版本开始:
    4.0
    作者:
    Rossen Stoyanchev, Juergen Hoeller