Class ExtendedWebExchangeDataBinder

All Implemented Interfaces:
PropertyEditorRegistry, TypeConverter

public class ExtendedWebExchangeDataBinder extends WebExchangeDataBinder
Extended variant of WebExchangeDataBinder that adds URI path variables and request headers to the bind values map.

Note: This class has existed since 5.0, but only as a private class within BindingContext.

Since:
6.2.1
Author:
Rossen Stoyanchev
  • Constructor Details

    • ExtendedWebExchangeDataBinder

      public ExtendedWebExchangeDataBinder(@Nullable Object target, String objectName)
  • Method Details

    • addHeaderPredicate

      public void addHeaderPredicate(Predicate<String> headerPredicate)
      Add a Predicate that filters the header names to use for data binding. Multiple predicates are combined with AND.
      Parameters:
      headerPredicate - the predicate to add
      Since:
      6.2.1
    • setHeaderPredicate

      public void setHeaderPredicate(Predicate<String> headerPredicate)
      Set the Predicate that filters the header names to use for data binding.

      Note that this method resets any previous predicates that may have been set, including headers excluded by default such as the RFC 9218 defined "Priority" header.

      Parameters:
      headerPredicate - the predicate to add
      Since:
      6.2.1
    • getValuesToBind

      public reactor.core.publisher.Mono<Map<String,Object>> getValuesToBind(ServerWebExchange exchange)
      Description copied from class: WebExchangeDataBinder
      Obtain the values for data binding. By default, this delegates to WebExchangeDataBinder.extractValuesToBind(ServerWebExchange).
      Overrides:
      getValuesToBind in class WebExchangeDataBinder
      Parameters:
      exchange - the current exchange
      Returns:
      a map of bind values