public class PathMatcher extends Object
PathNormalizer
.
Prefix tree is used to represent the matching
rules internally. Matching performance only depends on number segments in the path being matched,
does not depend on number of matching rules.Modifier and Type | Class and Description |
---|---|
static class |
PathMatcher.Builder |
static interface |
PathMatcher.RuleVisitor
Visitor for path matching rules
|
Modifier and Type | Method and Description |
---|---|
static PathMatcher.Builder |
builder()
Creates and returns new matcher builder.
|
static PathMatcher.Builder |
builder(PathNormalizer normalizer)
Creates and returns new path matcher builder.
|
String |
getMatchingRule(String path) |
boolean |
includes(String path)
Returns
true if the given path is matched by "includes" rule or false if the
path is matched by "excludes" rule. |
String |
toString() |
void |
traverse(PathMatcher.RuleVisitor visitor) |
public boolean includes(String path) throws IllegalArgumentException
true
if the given path is matched by "includes" rule or false
if the
path is matched by "excludes" rule.IllegalArgumentException
- if the given path is not match by any matcher rule.public String getMatchingRule(String path) throws IllegalArgumentException
IllegalArgumentException
public void traverse(PathMatcher.RuleVisitor visitor)
public static PathMatcher.Builder builder(PathNormalizer normalizer)
normalizer
.public static PathMatcher.Builder builder()
PathNormalizer
, but the builder itself will not normalize paths.Copyright © 2021. All rights reserved.