Class CompositeUriComponentsContributor
java.lang.Object
org.springframework.web.method.support.CompositeUriComponentsContributor
- All Implemented Interfaces:
- 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.- Since:
- 4.0
- Author:
- Rossen Stoyanchev, Juergen Hoeller, Sam Brannen
- 
Constructor SummaryConstructorsConstructorDescriptionCompositeUriComponentsContributor(@Nullable Collection<?> contributors, @Nullable ConversionService cs) Create an instance from a collection ofUriComponentsContributorsorHandlerMethodArgumentResolvers.CompositeUriComponentsContributor(Collection<?> contributors) Create an instance from a collection ofUriComponentsContributorsorHandlerMethodArgumentResolvers.CompositeUriComponentsContributor(UriComponentsContributor... contributors) Create an instance from a collection ofUriComponentsContributorsorHandlerMethodArgumentResolvers.
- 
Method SummaryModifier and TypeMethodDescriptionvoidcontributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String, Object> uriVariables) An overloaded method that uses the ConversionService created at construction.voidcontributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String, Object> uriVariables, ConversionService conversionService) Process the given method argument and either update theUriComponentsBuilderor add to the map with URI variables to use to expand the URI after all arguments are processed.booleanDetermine if thisCompositeUriComponentsContributorhas any contributors.booleansupportsParameter(MethodParameter parameter) Whether this contributor supports the given method parameter.
- 
Constructor Details- 
CompositeUriComponentsContributorCreate an instance from a collection ofUriComponentsContributorsorHandlerMethodArgumentResolvers. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configuredHandlerMethodArgumentResolversinRequestMappingHandlerAdapterand provide that to this constructor.- Parameters:
- contributors- a collection of- UriComponentsContributoror- HandlerMethodArgumentResolvers
 
- 
CompositeUriComponentsContributorCreate an instance from a collection ofUriComponentsContributorsorHandlerMethodArgumentResolvers. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configuredHandlerMethodArgumentResolversinRequestMappingHandlerAdapterand provide that to this constructor.- Parameters:
- contributors- a collection of- UriComponentsContributoror- HandlerMethodArgumentResolvers
 
- 
CompositeUriComponentsContributorpublic CompositeUriComponentsContributor(@Nullable Collection<?> contributors, @Nullable ConversionService cs) Create an instance from a collection ofUriComponentsContributorsorHandlerMethodArgumentResolvers. Since both of these tend to be implemented by the same class, the most convenient option is to obtain the configuredHandlerMethodArgumentResolversin theRequestMappingHandlerAdapterand provide that to this constructor.If the ConversionServiceargument isnull,DefaultFormattingConversionServicewill be used by default.- Parameters:
- contributors- a collection of- UriComponentsContributoror- HandlerMethodArgumentResolvers
- cs- a ConversionService to use when method argument values need to be formatted as Strings before being added to the URI
 
 
- 
- 
Method Details- 
hasContributorspublic boolean hasContributors()Determine if thisCompositeUriComponentsContributorhas any contributors.- Returns:
- trueif this- CompositeUriComponentsContributorwas created with contributors to delegate to
 
- 
supportsParameterDescription copied from interface:UriComponentsContributorWhether this contributor supports the given method parameter.- Specified by:
- supportsParameterin interface- UriComponentsContributor
 
- 
contributeMethodArgumentpublic void contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String, Object> uriVariables, ConversionService conversionService) Description copied from interface:UriComponentsContributorProcess the given method argument and either update theUriComponentsBuilderor add to the map with URI variables to use to expand the URI after all arguments are processed.- Specified by:
- contributeMethodArgumentin interface- UriComponentsContributor
- Parameters:
- 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
 
- 
contributeMethodArgumentpublic void contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String, Object> uriVariables) An overloaded method that uses the ConversionService created at construction.
 
-