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.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized T | Returns: object ornull if no match is found.the request path path)Implements org. |
| public synchronized void | register(final String
the regex to register the handler for. regex, final T the object. obj)Implements org. |
| public String | |
| public synchronized void | unregister(final String
the regex to unregister. regex)Implements org. |
| objectMap | back to summary |
|---|---|
| private final Map<String, T> objectMap | |
| patternMap | back to summary |
|---|---|
| private final Map<String, Pattern> patternMap | |
| UriRegexMatcher | back to summary |
|---|---|
| public UriRegexMatcher() | |
| lookup | back to summary |
|---|---|
| public synchronized T lookup(final String path) Implements org. Looks up an object matching the given request path. | |
| register | back to summary |
|---|---|
| public synchronized void register(final String regex, final T obj) Implements org. Registers the given object for URIs matching the given regex. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| unregister | back to summary |
|---|---|
| public synchronized void unregister(final String regex) Implements org. Removes registered object, if exists, for the given regex. | |