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.
| 构造器和说明 |
|---|
UriPatternMatcher() |
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 LookupRegistry<T>pattern - the pattern to register the handler for.obj - the object.public void unregister(String pattern)
unregister 在接口中 LookupRegistry<T>pattern - the pattern to unregister.public T lookup(String path)
lookup 在接口中 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 © 2023. All rights reserved.