T - The type of registered objects.@Contract(threading=SAFE) public class UriRegexMatcher<T> extends Object implements LookupRegistry<T>
The insertion order is in maintained in that map such that the lookup tests each regex until there is a match. This class can be used to resolve an object matching a particular request URI.
| 构造器和说明 |
|---|
UriRegexMatcher() |
| 限定符和类型 | 方法和说明 |
|---|---|
T |
lookup(String path)
Looks up an object matching the given request path.
|
void |
register(String regex,
T obj)
Registers the given object for URIs matching the given regex.
|
String |
toString() |
void |
unregister(String regex)
Removes registered object, if exists, for the given regex.
|
public void register(String regex, T obj)
register 在接口中 LookupRegistry<T>regex - the regex to register the handler for.obj - the object.public void unregister(String regex)
unregister 在接口中 LookupRegistry<T>regex - the regex to unregister.public T lookup(String path)
lookup 在接口中 LookupRegistry<T>path - the request pathnull if no match is found.Copyright © 2023. All rights reserved.