public class AntPathMatcher extends AbstractPatternSetMatcher<StringPatternEntry>
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
DEFAULT_PATH_SEPARATOR
Default path separator: "/"
|
defaultPatternSet, patternSetcaseSensitive, global, trimPattern| 构造器和说明 |
|---|
AntPathMatcher() |
AntPathMatcher(PatternSetExpressionParser<StringPatternEntry> expressionParser,
PatternSet<StringPatternEntry> defaultPatternSet) |
AntPathMatcher(PatternSetExpressionParser<StringPatternEntry> expressionParser,
PatternSet<StringPatternEntry> defaultPatternSet,
PatternSet patternSet) |
AntPathMatcher(PatternSetExpressionParser<StringPatternEntry> expressionParser,
String defaultPatternExpression) |
AntPathMatcher(PatternSetExpressionParser<StringPatternEntry> expressionParser,
String defaultPatternExpression,
String patternSetExpression) |
AntPathMatcher(String defaultPatternExpression) |
AntPathMatcher(String defaultPatternExpression,
String patternExpression) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
doMatch(String pattern,
String path,
boolean fullMatch)
Actually match the given
path against the given pattern. |
String |
extractPathWithinPattern(String pattern,
String path)
Given a pattern and a full path, determine the pattern-mapped part.
|
boolean |
matchStart(String pattern,
String path) |
void |
setPathSeparator(String pathSeparator)
Set the path separator to use for pattern parsing.
|
getDefaultPatternSet, match, setDefaultExpression, setDefaultPatternSet, setExpressionParser, setPatternExpression, setPatternSetsetCaseSensitive, setGlobal, setTrimPatternpublic AntPathMatcher()
public AntPathMatcher(@Nullable String defaultPatternExpression, @NonNull String patternExpression)
public AntPathMatcher(@NonNull PatternSetExpressionParser<StringPatternEntry> expressionParser, @Nullable String defaultPatternExpression)
public AntPathMatcher(@Nullable PatternSetExpressionParser<StringPatternEntry> expressionParser, @Nullable PatternSet<StringPatternEntry> defaultPatternSet)
public AntPathMatcher(@Nullable PatternSetExpressionParser<StringPatternEntry> expressionParser, @Nullable PatternSet<StringPatternEntry> defaultPatternSet, PatternSet patternSet)
public AntPathMatcher(@NonNull PatternSetExpressionParser<StringPatternEntry> expressionParser, @Nullable String defaultPatternExpression, String patternSetExpression)
public void setPathSeparator(String pathSeparator)
protected boolean doMatch(String pattern, String path, boolean fullMatch)
path against the given pattern.doMatch 在类中 AbstractPatternSetMatcher<StringPatternEntry>pattern - the pattern to match againstpath - the path String to testfullMatch - whether a full pattern match is required
(else a pattern match as far as the given base path goes is sufficient)true if the supplied path matched,
false if it didn'tpublic String extractPathWithinPattern(String pattern, String path)
For example:
/docs/cvs/commit.html' and '/docs/cvs/commit.html -> ''/docs/*' and '/docs/cvs/commit -> 'cvs/commit'/docs/cvs/*.html' and '/docs/cvs/commit.html -> 'commit.html'/docs/**' and '/docs/cvs/commit -> 'cvs/commit'/docs/**\/*.html' and '/docs/cvs/commit.html -> 'cvs/commit.html'/*.html' and '/docs/cvs/commit.html -> 'docs/cvs/commit.html'*.html' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html'*' and '/docs/cvs/commit.html -> '/docs/cvs/commit.html'Assumes that match(java.lang.String, java.lang.String) returns true for 'pattern'
and 'path', but does not enforce this.
Copyright © 2021. All rights reserved.