类 CompositeUriComponentsContributor

java.lang.Object
cn.taketoday.web.handler.method.support.CompositeUriComponentsContributor
所有已实现的接口:
UriComponentsContributor

public class CompositeUriComponentsContributor extends Object implements UriComponentsContributor
A UriComponentsContributor containing a list of other contributors to delegate to and also encapsulating a specific ConversionService to use for formatting method argument values as Strings.
从以下版本开始:
4.0 2022/4/7 22:03
作者:
Rossen Stoyanchev, Juergen Hoeller, Sam Brannen, Harry Yang
  • 字段详细资料

    • contributors

      private final List<Object> contributors
    • conversionService

      private final cn.taketoday.core.conversion.ConversionService conversionService
  • 构造器详细资料

    • CompositeUriComponentsContributor

      public CompositeUriComponentsContributor(UriComponentsContributor... contributors)
      Create an instance from a collection of UriComponentsContributors or ParameterResolvingStrategies. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configured ParameterResolvingStrategies in RequestMappingHandlerAdapter and provide that to this constructor.
      参数:
      contributors - a collection of UriComponentsContributor or ParameterResolvingStrategies
    • CompositeUriComponentsContributor

      public CompositeUriComponentsContributor(Collection<?> contributors)
      Create an instance from a collection of UriComponentsContributors or ParameterResolvingStrategies. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configured ParameterResolvingStrategies in RequestMappingHandlerAdapter and provide that to this constructor.
      参数:
      contributors - a collection of UriComponentsContributor or ParameterResolvingStrategies
    • CompositeUriComponentsContributor

      public CompositeUriComponentsContributor(@Nullable Collection<?> contributors, @Nullable cn.taketoday.core.conversion.ConversionService cs)
      Create an instance from a collection of UriComponentsContributors or ParameterResolvingStrategies. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configured ParameterResolvingStrategies in the RequestMappingHandlerAdapter and provide that to this constructor.

      If the ConversionService argument is null, DefaultFormattingConversionService will be used by default.

      参数:
      contributors - a collection of UriComponentsContributor or ParameterResolvingStrategies
      cs - a ConversionService to use when method argument values need to be formatted as Strings before being added to the URI
  • 方法详细资料

    • hasContributors

      public boolean hasContributors()
      Determine if this CompositeUriComponentsContributor has any contributors.
      返回:
      true if this CompositeUriComponentsContributor was created with contributors to delegate to
    • supportsParameter

      public boolean supportsParameter(cn.taketoday.core.MethodParameter parameter)
      从接口复制的说明: UriComponentsContributor
      Whether this contributor supports the given method parameter.
      指定者:
      supportsParameter 在接口中 UriComponentsContributor
    • contributeMethodArgument

      public void contributeMethodArgument(cn.taketoday.core.MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, cn.taketoday.core.conversion.ConversionService conversionService)
      从接口复制的说明: UriComponentsContributor
      Process the given method argument and either update the UriComponentsBuilder or add to the map with URI variables to use to expand the URI after all arguments are processed.
      指定者:
      contributeMethodArgument 在接口中 UriComponentsContributor
      参数:
      parameter - the controller method parameter (never null)
      value - the argument value (possibly null)
      builder - the builder to update (never null)
      uriVariables - a map to add URI variables to (never null)
      conversionService - a ConversionService to format values as Strings
    • contributeMethodArgument

      public void contributeMethodArgument(cn.taketoday.core.MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables)
      An overloaded method that uses the ConversionService created at construction.