org.springframework.util
Class AntPathStringMatcher
java.lang.Object
org.springframework.util.AntPathStringMatcher
class AntPathStringMatcher
- extends java.lang.Object
Package-protected helper class for AntPathMatcher
. Tests whether or not a string matches against a pattern
via a Pattern
.
The pattern may contain special characters: '*' means zero or more characters; '?' means one and only one
character; '{' and '}' indicate a URI template pattern. For example /users/{user}.
- Since:
- 3.0
- Author:
- Arjen Poutsma, Rossen Stoyanchev
Constructor Summary |
AntPathStringMatcher(java.lang.String pattern,
java.lang.String str,
java.util.Map<java.lang.String,java.lang.String> uriTemplateVariables)
Construct a new instance of the AntPatchStringMatcher . |
Method Summary |
private java.util.regex.Pattern |
createPattern(java.lang.String pattern)
|
boolean |
matchStrings()
Main entry point. |
private java.lang.String |
quote(java.lang.String s,
int start,
int end)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GLOB_PATTERN
private static final java.util.regex.Pattern GLOB_PATTERN
DEFAULT_VARIABLE_PATTERN
private static final java.lang.String DEFAULT_VARIABLE_PATTERN
- See Also:
- Constant Field Values
pattern
private final java.util.regex.Pattern pattern
str
private java.lang.String str
variableNames
private final java.util.List<java.lang.String> variableNames
uriTemplateVariables
private final java.util.Map<java.lang.String,java.lang.String> uriTemplateVariables
AntPathStringMatcher
AntPathStringMatcher(java.lang.String pattern,
java.lang.String str,
java.util.Map<java.lang.String,java.lang.String> uriTemplateVariables)
- Construct a new instance of the
AntPatchStringMatcher
.
createPattern
private java.util.regex.Pattern createPattern(java.lang.String pattern)
quote
private java.lang.String quote(java.lang.String s,
int start,
int end)
matchStrings
public boolean matchStrings()
- Main entry point.
- Returns:
true
if the string matches against the pattern, or false
otherwise.