Package org.apache.juneau.rest.util
Class UrlPathMatcher
java.lang.Object
org.apache.juneau.rest.util.UrlPathMatcher
- All Implemented Interfaces:
- Comparable<UrlPathMatcher>
A parsed path pattern constructed from a 
@RestOp(path) value.
 Handles aspects of matching and precedence ordering.
See Also:
- 
Method SummaryModifier and TypeMethodDescriptionintComparator for this object.protected abstract StringReturns a string that can be used to compare this matcher with other matchers to provide the ability to order URL patterns from most-specific to least-specific.String[]getVars()Returns the variable names found in the pattern.booleanhasVars()Returnstrue if this path pattern contains variables.abstract UrlPathMatchReturns a non-null value if the specified path matches this pattern.static UrlPathMatcherConstructs a matcher from the specified pattern string.toString()
- 
Method Details- 
ofConstructs a matcher from the specified pattern string.- Parameters:
- pattern- The pattern string.
- Returns:
- A new matcher.
 
- 
matchReturns a non-null value if the specified path matches this pattern.- Parameters:
- pathInfo- The path to match against.
- Returns:
- A pattern match object, or null if the path didn't match this pattern.
 
- 
getComparatorReturns a string that can be used to compare this matcher with other matchers to provide the ability to order URL patterns from most-specific to least-specific.- Returns:
- A comparison string.
 
- 
getVarsReturns the variable names found in the pattern.- Returns:
- The variable names or an empty array if no variables found.
   
 Modifying the returned array does not modify this object.
 
- 
hasVarsReturnstrue if this path pattern contains variables.- Returns:
- true if this path pattern contains variables.
 
- 
compareToComparator for this object.The comparator is designed to order URL pattern from most-specific to least-specific. For example, the following patterns would be ordered as follows: - foo.bar 
- *.bar 
- /foo/bar 
- /foo/bar/* 
- /foo/{id}/bar 
- /foo/{id}/bar/* 
- /foo/{id} 
- /foo/{id}/* 
- /foo 
- /foo/* 
 - Specified by:
- compareToin interface- Comparable<UrlPathMatcher>
 
- 
toString
 
-