public class UriPatternMatcher
extends java.lang.Object
*
*<uri>
<uri>*
Constructor and Description |
---|
UriPatternMatcher() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
lookup(java.lang.String requestURI)
Looks up an object matching the given request URI.
|
protected boolean |
matchUriRequestPattern(java.lang.String pattern,
java.lang.String requestUri)
Tests if the given request URI matches the given pattern.
|
void |
register(java.lang.String pattern,
java.lang.Object obj)
Registers the given object for URIs matching the given pattern.
|
void |
setHandlers(java.util.Map map)
Sets objects from the given map.
|
void |
unregister(java.lang.String pattern)
Removes registered object, if exists, for the given pattern.
|
public void register(java.lang.String pattern, java.lang.Object obj)
pattern
- the pattern to register the handler for.obj
- the object.public void unregister(java.lang.String pattern)
pattern
- the pattern to unregister.public void setHandlers(java.util.Map map)
map
- the map containing objects keyed by their URI patterns.
public java.lang.Object lookup(java.lang.String requestURI)
requestURI
- the request URInull
if no match is found.protected boolean matchUriRequestPattern(java.lang.String pattern, java.lang.String requestUri)
pattern
- the patternrequestUri
- the request URItrue
if the request URI matches the pattern,
false
otherwise.