Class AbstractNamedValueMethodArgumentResolver

java.lang.Object
org.springframework.messaging.handler.annotation.support.AbstractNamedValueMethodArgumentResolver
All Implemented Interfaces:
HandlerMethodArgumentResolver
Direct Known Subclasses:
DestinationVariableMethodArgumentResolver, HeaderMethodArgumentResolver

public abstract class AbstractNamedValueMethodArgumentResolver extends Object implements HandlerMethodArgumentResolver
Abstract base class to resolve method arguments from a named value, for example, message headers or destination variables. Named values could have one or more of a name, a required flag, and a default value.

Subclasses only need to define specific steps such as how to obtain named value details from a method parameter, how to resolve to argument values, or how to handle missing values.

A default value string can contain ${...} placeholders and Spring Expression Language #{...} expressions which will be resolved if a ConfigurableBeanFactory is supplied to the class constructor.

A ConversionService is used to convert a resolved String argument value to the expected target method parameter type.

Since:
4.0
Author:
Rossen Stoyanchev, Juergen Hoeller
  • Constructor Details

    • AbstractNamedValueMethodArgumentResolver

      protected AbstractNamedValueMethodArgumentResolver(org.springframework.core.convert.ConversionService conversionService, @Nullable org.springframework.beans.factory.config.ConfigurableBeanFactory beanFactory)
      Constructor with a ConversionService and a BeanFactory.
      Parameters:
      conversionService - conversion service for converting String values to the target method parameter type
      beanFactory - a bean factory for resolving ${...} placeholders and #{...} SpEL expressions in default values
  • Method Details