}
return annot.value()[0];
}
private static UriComponents applyContributors(UriComponentsBuilder builder, Method method, Object... args) {
CompositeUriComponentsContributor contributor = getConfiguredUriComponentsContributor();
if (contributor == null) {
logger.debug("Using default CompositeUriComponentsContributor");
contributor = defaultUriComponentsContributor;
}
int paramCount = method.getParameterTypes().length;
int argCount = args.length;
if (paramCount != argCount) {
throw new IllegalArgumentException("Number of method parameters " + paramCount +
" does not match number of argument values " + argCount);
}
final Map<String, Object> uriVars = new HashMap<String, Object>();
for (int i = 0; i < paramCount; i++) {
MethodParameter param = new MethodParameter(method, i);
param.initParameterNameDiscovery(parameterNameDiscoverer);
contributor.contributeMethodArgument(param, args[i], builder, uriVars);
}
// We may not have all URI var values, expand only what we have
return builder.build().expand(new UriComponents.UriTemplateVariables() {
@Override