}
}
Object handler = ctx.getBean(handlerServiceClass);
Method serviceMethod = ClassUtils.getMethod(handlerServiceClass, methodName, paramTypes);
RequestMappingInfo mapping = getMappingForMethod(method, marshallingServiceClass);
if (relative) {
List<String> patterns = new ArrayList<String>();
for (String pattern : mapping.getPatternsCondition().getPatterns()) {
// add REST resource path prefix to URI,
// if relative path is just '/' add an empty string
patterns.add(restResource.path() + (!"/".equals(pattern) ? pattern : ""));
}
// create a new mapping based on the patterns (patterns are unmodifiable in existing RequestMappingInfo)
mapping = new RequestMappingInfo(
new PatternsRequestCondition(patterns.toArray(ArrayUtils.EMPTY_STRING_ARRAY),
getUrlPathHelper(), getPathMatcher(),
useSuffixPatternMatch(), useTrailingSlashMatch()),
mapping.getMethodsCondition(), mapping.getParamsCondition(), mapping.getHeadersCondition(),
mapping.getConsumesCondition(), mapping.getProducesCondition(), mapping.getCustomCondition());
}
// need to set param types to use in createHandlerMethod before calling registerHandlerMethod
restBridgedMethod = BridgeMethodResolver.findBridgedMethod(method);