spring-framework / org.springframework.web.method.support / CompositeUriComponentsContributor

CompositeUriComponentsContributor

open class CompositeUriComponentsContributor : UriComponentsContributor

A UriComponentsContributor containing a list of other contributors to delegate and also encapsulating a specific ConversionService to use for formatting method argument values to Strings.

Author
Rossen Stoyanchev

Since
4.0

Constructors

<init>

CompositeUriComponentsContributor(vararg contributors: UriComponentsContributor)
CompositeUriComponentsContributor(contributors: MutableCollection<*>)

Create an instance from a collection of UriComponentsContributors or HandlerMethodArgumentResolvers. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configured HandlerMethodArgumentResolvers in RequestMappingHandlerAdapter and provide that to this constructor.

CompositeUriComponentsContributor(contributors: MutableCollection<*>, cs: ConversionService)

Create an instance from a collection of UriComponentsContributors or HandlerMethodArgumentResolvers. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configured HandlerMethodArgumentResolvers in the RequestMappingHandlerAdapter and provide that to this constructor.

If the ConversionService argument is null, org.springframework.format.support.DefaultFormattingConversionService will be used by default.

Functions

contributeMethodArgument

open fun contributeMethodArgument(parameter: MethodParameter, value: Any, builder: UriComponentsBuilder, uriVariables: MutableMap<String, Any>, conversionService: ConversionService): Unitopen fun contributeMethodArgument(parameter: MethodParameter, value: Any, builder: UriComponentsBuilder, uriVariables: MutableMap<String, Any>): Unit

An overloaded method that uses the ConversionService created at construction.

hasContributors

open fun hasContributors(): Boolean

supportsParameter

open fun supportsParameter(parameter: MethodParameter): Boolean