Map<String, Resource> uri2ResourceMap = new HashMap<String, Resource>();
for (MethodMetadata subResourceLocator : subResourceLocators) {
UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
String uri = SLASH + uriTemplate.getTemplate() + subResourceLocator.getPath();
org.apache.wink.common.internal.model.admin.Methods xmlSRL =
createXMLSubResourceLocatorMethod(subResourceLocator);
addResourceMethods(uri2ResourceMap, uri, xmlSRL);
}
// Add all Sub Resource Locators as resources
resources.getResource().addAll(uri2ResourceMap.values());
uri2ResourceMap.clear();
for (MethodMetadata subResourceMethod : subResourceMethods) {
UriTemplateProcessor uriTemplate = record.getTemplateProcessor();
String uri = SLASH + uriTemplate.getTemplate() + SLASH + subResourceMethod.getPath();
org.apache.wink.common.internal.model.admin.Methods xmlSRM =
createXMLSubResourceMethod(subResourceMethod);
addResourceMethods(uri2ResourceMap, uri, xmlSRM);
}