类 SimpleRouteMatcher
java.lang.Object
cn.taketoday.util.SimpleRouteMatcher
- 所有已实现的接口:
RouteMatcher
RouteMatcher that delegates to a PathMatcher.
Note: This implementation is not efficient since
PathMatcher treats paths and patterns as Strings. For more optimized
performance use the PathPatternRouteMatcher from today-web
which enables use of parsed routes and patterns.
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, TODAY 2021/11/6 20:49
-
嵌套类概要
从接口继承的嵌套类/接口 cn.taketoday.util.RouteMatcher
RouteMatcher.Route -
构造器概要
构造器构造器说明SimpleRouteMatcher(PathMatcher pathMatcher) Create a newSimpleRouteMatcherfor the givenPathMatcherdelegate. -
方法概要
修饰符和类型方法说明Combines two patterns into a single pattern.Return the underlyingPathMatcherdelegate.Given a route, return aComparatorsuitable for sorting patterns in order of explicitness for that route, so that more specific patterns come before more generic ones.booleanWhether the givenroutecontains pattern syntax which requires theRouteMatcher.match(String, Route)method, or if it is a regular String that could be compared directly to others.booleanmatch(String pattern, RouteMatcher.Route route) Match the given route against the given pattern.matchAndExtract(String pattern, RouteMatcher.Route route) Match the pattern to the route and extract template variables.parseRoute(String route) Return a parsed representation of the given route.
-
构造器详细资料
-
SimpleRouteMatcher
Create a newSimpleRouteMatcherfor the givenPathMatcherdelegate.
-
-
方法详细资料
-
getPathMatcher
Return the underlyingPathMatcherdelegate. -
parseRoute
从接口复制的说明:RouteMatcherReturn a parsed representation of the given route.- 指定者:
parseRoute在接口中RouteMatcher- 参数:
route- the route to parse- 返回:
- the parsed representation of the route
-
isPattern
从接口复制的说明:RouteMatcherWhether the givenroutecontains pattern syntax which requires theRouteMatcher.match(String, Route)method, or if it is a regular String that could be compared directly to others.- 指定者:
isPattern在接口中RouteMatcher- 参数:
route- the route to check- 返回:
trueif the givenrouterepresents a pattern
-
combine
从接口复制的说明:RouteMatcherCombines two patterns into a single pattern.- 指定者:
combine在接口中RouteMatcher- 参数:
pattern1- the first patternpattern2- the second pattern- 返回:
- the combination of the two patterns
-
match
从接口复制的说明:RouteMatcherMatch the given route against the given pattern.- 指定者:
match在接口中RouteMatcher- 参数:
pattern- the pattern to try to matchroute- the route to test against- 返回:
trueif there is a match,falseotherwise
-
matchAndExtract
从接口复制的说明:RouteMatcherMatch the pattern to the route and extract template variables.- 指定者:
matchAndExtract在接口中RouteMatcher- 参数:
pattern- the pattern, possibly containing templates variablesroute- the route to extract template variables from- 返回:
- a map with template variables and values
-
getPatternComparator
从接口复制的说明:RouteMatcherGiven a route, return aComparatorsuitable for sorting patterns in order of explicitness for that route, so that more specific patterns come before more generic ones.- 指定者:
getPatternComparator在接口中RouteMatcher- 参数:
route- the full path to use for comparison- 返回:
- a comparator capable of sorting patterns in order of explicitness
-