* and requesting that plug-in to do the canonicalization.
* @param uri the URI to canonicalize
* @return the canonicalized URI
*/
URI canonicalize(URI uri) {
UriAliasHandler handler = null;
Map<String, PatternMapping<UriAliasHandler>> mappings;
synchronized (this) {
mappings = uriAliasHandlerMappings;
}
for (PatternMapping<UriAliasHandler> mapping : mappings.values()) {
if (mapping.regexpPattern.matcher(uri.toString()).find()) {
handler = mapping.mappedObject;
break;
}
}
return (handler != null) ? handler.canonicalize(uri) : uri;
}