Returns a new instance with URL patterns from the current instance ("this") and
the "other" instance as follows:
If there are patterns in both instances, combine the patterns in "this" with
the patterns in "other" using PathMatcher.combine(String, String).
Checks if any of the patterns match the given request and returns an instance
that is guaranteed to contain matching patterns, sorted via
PathMatcher.getPatternComparator(String).
Checks if any of the patterns match the given request and returns an instance
that is guaranteed to contain matching patterns, sorted via
PathMatcher.getPatternComparator(String).
A matching pattern is obtained by making checks in the following order:
Direct match
Pattern match with ".*" appended if the pattern doesn't already contain a "."
Pattern match
Pattern match with "/" appended if the pattern doesn't already end in "/"
Parameters:
request - the current request
Returns:
the same instance if the condition contains no patterns;
or a new condition with sorted matching patterns;
or null if no patterns match.
getMatchingPatterns
public java.util.List<java.lang.String> getMatchingPatterns(java.lang.String lookupPath)
Find the patterns matching the given lookup path. Invoking this method should
yield results equivalent to those of calling
getMatchingCondition(javax.servlet.http.HttpServletRequest).
This method is provided as an alternative to be used if no request is available
(e.g. introspection, tooling, etc).
Parameters:
lookupPath - the lookup path to match to existing patterns
Returns:
a collection of matching patterns sorted with the closest match at the top
Compare the two conditions based on the URL patterns they contain.
Patterns are compared one at a time, from top to bottom via
PathMatcher.getPatternComparator(String). If all compared
patterns match equally, but one instance has more patterns, it is
considered a closer match.
It is assumed that both instances have been obtained via
getMatchingCondition(HttpServletRequest) to ensure they
contain only patterns that match the request and are sorted with
the best matches on top.