final AbstractResource resource,
final RulesMap<UriRule> rulesMap) {
for (final AbstractSubResourceLocator locator : resource.getSubResourceLocators()) {
PathPattern p = null;
try {
p = new PathPattern(new PathTemplate(locator.getPath().getValue()));
} catch (IllegalArgumentException ex) {
Errors.error(String.format("Illegal URI template for sub-resource locator %s: %s",
locator.getMethod(), ex.getMessage()));
continue;
}