Class ActionNameSpecificityComparator

java.lang.Object
org.apache.struts2.convention.ActionNameSpecificityComparator
All Implemented Interfaces:
Comparator<String>

public class ActionNameSpecificityComparator extends Object implements 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:

  1. fewer wildcard tokens first (a */** run, or a {var} group);
  2. more literal characters first;
  3. fewer path-spanning ** tokens first;
  4. 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 Details

    • ActionNameSpecificityComparator

      public ActionNameSpecificityComparator()
  • Method Details