T - The type of registered objects.@Contract(threading=SAFE) public class UriPatternMatcher<T> extends Object implements LookupRegistry<T>
Patterns may have three formats:
**<uri><uri>*This class can be used to resolve an object matching a particular request URI.
| Constructor and Description |
|---|
UriPatternMatcher() |
| Modifier and Type | Method and Description |
|---|---|
Set<Map.Entry<String,T>> |
entrySet()
Returns a
Set view of the mappings contained in this matcher. |
T |
lookup(String path)
Looks up an object matching the given request path.
|
protected boolean |
matchUriRequestPattern(String pattern,
String path)
Tests if the given request path matches the given pattern.
|
void |
register(String pattern,
T obj)
Registers the given object for URIs matching the given pattern.
|
String |
toString() |
void |
unregister(String pattern)
Removes registered object, if exists, for the given pattern.
|
public Set<Map.Entry<String,T>> entrySet()
Set view of the mappings contained in this matcher.Map.entrySet()public void register(String pattern, T obj)
register in interface LookupRegistry<T>pattern - the pattern to register the handler for.obj - the object.public void unregister(String pattern)
unregister in interface LookupRegistry<T>pattern - the pattern to unregister.public T lookup(String path)
lookup in interface LookupRegistry<T>path - the request pathnull if no match is found.protected boolean matchUriRequestPattern(String pattern, String path)
pattern - the patternpath - the request pathtrue if the request URI matches the pattern, false otherwise.Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.