Package org.springframework.util
Class SimpleRouteMatcher
java.lang.Object
org.springframework.util.SimpleRouteMatcher
- All Implemented Interfaces:
- 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 spring-web
 which enables use of parsed routes and patterns.
- Since:
- 5.2
- Author:
- Rossen Stoyanchev
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.springframework.util.RouteMatcherRouteMatcher.Route
- 
Constructor SummaryConstructorsConstructorDescriptionSimpleRouteMatcher(PathMatcher pathMatcher) Create a newSimpleRouteMatcherfor the givenPathMatcherdelegate.
- 
Method SummaryModifier and TypeMethodDescriptionCombines 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.
- 
Constructor Details- 
SimpleRouteMatcherCreate a newSimpleRouteMatcherfor the givenPathMatcherdelegate.
 
- 
- 
Method Details- 
getPathMatcherReturn the underlyingPathMatcherdelegate.
- 
parseRouteDescription copied from interface:RouteMatcherReturn a parsed representation of the given route.- Specified by:
- parseRoutein interface- RouteMatcher
- Parameters:
- route- the route to parse
- Returns:
- the parsed representation of the route
 
- 
isPatternDescription copied from interface: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.- Specified by:
- isPatternin interface- RouteMatcher
- Parameters:
- route- the route to check
- Returns:
- trueif the given- routerepresents a pattern
 
- 
combineDescription copied from interface:RouteMatcherCombines two patterns into a single pattern.- Specified by:
- combinein interface- RouteMatcher
- Parameters:
- pattern1- the first pattern
- pattern2- the second pattern
- Returns:
- the combination of the two patterns
 
- 
matchDescription copied from interface:RouteMatcherMatch the given route against the given pattern.- Specified by:
- matchin interface- RouteMatcher
- Parameters:
- pattern- the pattern to try to match
- route- the route to test against
- Returns:
- trueif there is a match,- falseotherwise
 
- 
matchAndExtractDescription copied from interface:RouteMatcherMatch the pattern to the route and extract template variables.- Specified by:
- matchAndExtractin interface- RouteMatcher
- Parameters:
- pattern- the pattern, possibly containing templates variables
- route- the route to extract template variables from
- Returns:
- a map with template variables and values
 
- 
getPatternComparatorDescription copied from interface: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.- Specified by:
- getPatternComparatorin interface- RouteMatcher
- Parameters:
- route- the full path to use for comparison
- Returns:
- a comparator capable of sorting patterns in order of explicitness
 
 
-