Class UriPatternMatcher<T>
java.lang.Object
org.apache.hc.core5.http.protocol.UriPatternMatcher<T>
- Type Parameters:
T
- The type of registered objects.
- All Implemented Interfaces:
LookupRegistry<T>
@Contract(threading=SAFE)
public class UriPatternMatcher<T>
extends Object
implements LookupRegistry<T>
Maintains a map of objects keyed by a request URI pattern.
Patterns may have three formats:
*
*<uri>
<uri>*
This class can be used to resolve an object matching a particular request URI.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionentrySet()
Returns aSet
view of the mappings contained in this matcher.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
Registers the given object for URIs matching the given pattern.toString()
void
unregister
(String pattern) Removes registered object, if exists, for the given pattern.
-
Field Details
-
map
-
-
Constructor Details
-
UriPatternMatcher
public UriPatternMatcher()
-
-
Method Details
-
entrySet
Returns aSet
view of the mappings contained in this matcher.- Returns:
- a set view of the mappings contained in this matcher.
- Since:
- 4.4.9
- See Also:
-
register
Registers the given object for URIs matching the given pattern.- Specified by:
register
in interfaceLookupRegistry<T>
- Parameters:
pattern
- the pattern to register the handler for.obj
- the object.
-
unregister
Removes registered object, if exists, for the given pattern.- Specified by:
unregister
in interfaceLookupRegistry<T>
- Parameters:
pattern
- the pattern to unregister.
-
lookup
Looks up an object matching the given request path.- Specified by:
lookup
in interfaceLookupRegistry<T>
- Parameters:
path
- the request path- Returns:
- object or
null
if no match is found.
-
matchUriRequestPattern
Tests if the given request path matches the given pattern.- Parameters:
pattern
- the patternpath
- the request path- Returns:
true
if the request URI matches the pattern,false
otherwise.
-
toString
-