类 CompositeUriComponentsContributor
- java.lang.Object
- org.springframework.web.method.support.CompositeUriComponentsContributor
- 所有已实现的接口:
UriComponentsContributor
public class CompositeUriComponentsContributor extends Object implements UriComponentsContributor
AUriComponentsContributor
containing a list of other contributors to delegate and also encapsulating a specificConversionService
to use for formatting method argument values to Strings.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 CompositeUriComponentsContributor(Collection<?> contributors)
Create an instance from a collection ofUriComponentsContributor
s orHandlerMethodArgumentResolver
s.CompositeUriComponentsContributor(Collection<?> contributors, ConversionService cs)
Create an instance from a collection ofUriComponentsContributor
s orHandlerMethodArgumentResolver
s.CompositeUriComponentsContributor(UriComponentsContributor... contributors)
Create an instance from a collection ofUriComponentsContributor
s orHandlerMethodArgumentResolver
s.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables)
An overloaded method that uses the ConversionService created at construction.void
contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, ConversionService conversionService)
Process the given method argument and either update theUriComponentsBuilder
or add to the map with URI variables to use to expand the URI after all arguments are processed.boolean
hasContributors()
boolean
supportsParameter(MethodParameter parameter)
Whether this contributor supports the given method parameter.
构造器详细资料
CompositeUriComponentsContributor
public CompositeUriComponentsContributor(UriComponentsContributor... contributors)
Create an instance from a collection ofUriComponentsContributor
s orHandlerMethodArgumentResolver
s. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configuredHandlerMethodArgumentResolvers
inRequestMappingHandlerAdapter
and provide that to this constructor.- 参数:
contributors
- a collection ofUriComponentsContributor
orHandlerMethodArgumentResolver
s.
CompositeUriComponentsContributor
public CompositeUriComponentsContributor(Collection<?> contributors)
Create an instance from a collection ofUriComponentsContributor
s orHandlerMethodArgumentResolver
s. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configuredHandlerMethodArgumentResolvers
inRequestMappingHandlerAdapter
and provide that to this constructor.- 参数:
contributors
- a collection ofUriComponentsContributor
orHandlerMethodArgumentResolver
s.
CompositeUriComponentsContributor
public CompositeUriComponentsContributor(Collection<?> contributors, ConversionService cs)
Create an instance from a collection ofUriComponentsContributor
s orHandlerMethodArgumentResolver
s. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configuredHandlerMethodArgumentResolvers
in theRequestMappingHandlerAdapter
and provide that to this constructor.If the
ConversionService
argument isnull
,DefaultFormattingConversionService
will be used by default.- 参数:
contributors
- a collection ofUriComponentsContributor
orHandlerMethodArgumentResolver
s.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()
supportsParameter
public boolean supportsParameter(MethodParameter parameter)
从接口复制的说明:UriComponentsContributor
Whether this contributor supports the given method parameter.
contributeMethodArgument
public void contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, ConversionService conversionService)
从接口复制的说明:UriComponentsContributor
Process the given method argument and either update theUriComponentsBuilder
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 (nevernull
)value
- the argument value (possiblynull
)builder
- the builder to update (nevernull
)uriVariables
- a map to add URI variables to (nevernull
)conversionService
- a ConversionService to format values as Strings
contributeMethodArgument
public void contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables)
An overloaded method that uses the ConversionService created at construction.