String-based path matching.
Used by org.,
org.,
and org..
The default implementation is AntPathMatcher, supporting the
Ant-style pattern syntax.
AntPathMatcher
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public String | Returns: the pattern-mapped part of the givenpath
(never null)the path pattern pattern, String the full path to introspect path)Given a pattern and a full path, determine the pattern-mapped part. |
| public Map | Returns: a map, containing variable names as keys; variables values as valuesthe path pattern, possibly containing URI templates pattern, String the full path to extract template variables from path)Given a pattern and a full path, extract the URI template variables. |
| public Comparator | Returns: a comparator capable of sorting patterns in order of explicitnessthe full path to use for comparison path)Given a full path, returns a |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if the supplied path matched,
false if it didn'tthe pattern to match against pattern, String the path to test path)Match the given |
| combine | back to summary |
|---|---|
| public String combine(String pattern1, String pattern2) Combines two patterns into a new pattern that is returned. The full algorithm used for combining the two pattern depends on the underlying implementation.
| |
| extractPathWithinPattern | back to summary |
|---|---|
| public String extractPathWithinPattern(String pattern, String path) Given a pattern and a full path, determine the pattern-mapped part. This method is supposed to find out which part of the path is matched dynamically through an actual pattern, that is, it strips off a statically defined leading path from the given full path, returning only the actually pattern-matched part of the path. For example: For "myroot/*.html" as pattern and "myroot/myfile.html" as full path, this method should return "myfile.html". The detailed determination rules are specified to this PathMatcher's matching strategy. A simple implementation may return the given full path as-is in case
of an actual pattern, and the empty String in case of the pattern not
containing any dynamic parts (i.e. the | |
| extractUriTemplateVariables | back to summary |
|---|---|
| public Map Given a pattern and a full path, extract the URI template variables. URI template variables are expressed through curly brackets ('{' and '}'). For example: For pattern "/hotels/{hotel}" and path "/hotels/1", this method will return a map containing "hotel" → "1". | |
| getPatternComparator | back to summary |
|---|---|
| public Comparator Given a full path, returns a The full algorithm used depends on the underlying implementation,
but generally, the returned
| |
| isPattern | back to summary |
|---|---|
| public boolean isPattern(String path) Does the given If the return value is
| |
| match | back to summary |
|---|---|
| public boolean match(String pattern, String path) Match the given | |
| matchStart | back to summary |
|---|---|
| public boolean matchStart(String pattern, String path) Match the given Determines whether the pattern at least matches as far as the given base path goes, assuming that a full path may then match as well. | |