Package org.apache.struts2.convention
Class ActionNameSpecificityComparator
java.lang.Object
org.apache.struts2.convention.ActionNameSpecificityComparator
- All Implemented Interfaces:
Comparator<String>
Orders wildcard action-name patterns most-specific-first so that, under the framework's
first-match-wins matching, a specific pattern (e.g.
some/usefull/*) is evaluated
before a general one (e.g. some/*).
Ordering keys, applied in order:
- fewer wildcard tokens first (a
*/**run, or a{var}group); - more literal characters first;
- fewer path-spanning
**tokens first; - natural (alphabetical) order of the pattern, for deterministic tie-breaking.
Matcher-agnostic: it recognises both */** (WildcardHelper) and
{var} (NamedVariablePatternMatcher) wildcards.
- Since:
- 7.3.0 (WW-3784)
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ActionNameSpecificityComparator
public ActionNameSpecificityComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<String>
-