public class PathMatcher<T> extends Object
This only matches a single level of a request, e.g if you have a request that takes the form:
/foo/bar
Modifier and Type | Class and Description |
---|---|
static class | PathMatcher.PathMatch<T> |
Constructor and Description |
---|
PathMatcher() |
PathMatcher(T defaultHandler) |
Modifier and Type | Method and Description |
---|---|
PathMatcher | addExactPath(String path, T handler) |
PathMatcher | addPrefixPath(String path, T handler) Adds a path prefix and a handler for that path. |
PathMatcher | clearPaths() |
T | getExactPath(String path) |
Map<String,T> | getPaths() |
T | getPrefixPath(String path) |
PathMatcher.PathMatch<T> | match(String path) Matches a path against the registered handlers. |
PathMatcher | removeExactPath(String path) |
PathMatcher | removePath(String path) Deprecated. |
PathMatcher | removePrefixPath(String path) |
public PathMatcher(T defaultHandler)
public PathMatcher()
public PathMatcher.PathMatch<T> match(String path)
path
- The relative path to matchpublic PathMatcher addPrefixPath(String path, T handler)
The match is done on a prefix bases, so registering /foo will also match /bar. Exact path matches are taken into account first.
If / is specified as the path then it will replace the default handler.
path
- The pathhandler
- The handlerpublic PathMatcher addExactPath(String path, T handler)
@Deprecated public PathMatcher removePath(String path)
public PathMatcher removePrefixPath(String path)
public PathMatcher removeExactPath(String path)
public PathMatcher clearPaths()
Copyright © 2015 JBoss by Red Hat. All rights reserved.