Map<String, String> inheritedPathParams) throws HandlerException,
UnsupportedFieldType {
SortedSet<MethodDescriptor> methodDescriptors = getSubThingMethodDescriptors(instance.getClass());
Set<Method> result;
result = new HashSet<Method>();
URITemplate uriTemplateOfFirstMatchingRM = null;
Map<String, String> subPathParam = null;
for (MethodDescriptor methodDescriptor : methodDescriptors) {
final URITemplate currentUriTemplate = methodDescriptor.getUriTemplate();
if (uriTemplateOfFirstMatchingRM != null) {
if (uriTemplateOfFirstMatchingRM.equals(currentUriTemplate)
&& !methodDescriptor.isSubResourceLocator()) {
result.add(methodDescriptor.getMethod());
method2PathParams.put(methodDescriptor.getMethod(),
subPathParam);
continue;
}
break;
}
PathMatching subPathMatching = currentUriTemplate.match(remainingPath);
if (subPathMatching == null) {
continue;
}
subPathParam = new HashMap<String, String>(inheritedPathParams);
subPathParam.putAll(subPathMatching.getParameters());