/** * Checks if provided class package is on the exclude list * * @param classPackageName name of class package * @return false if class package is on the {@link #excludePackages} list */ protected boolean checkExcludePackages(String classPackageName) { if(excludePackages != null && excludePackages.length > 0) { WildcardHelper wildcardHelper = new WildcardHelper(); //we really don't care about the results, just the boolean Map<String, String> matchMap = new HashMap<>(); for(String packageExclude : excludePackages) { int[] packagePattern = wildcardHelper.compilePattern(packageExclude); if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) { return false; } } } return true; }
if (!matchArray(expr, exprpos, charpos, buff, buffpos)) { return (false); offset = indexOfArray(expr, exprpos, charpos, buff, buffpos); ? indexOfArray(expr, exprpos, charpos, buff, buffpos) : lastIndexOfArray(expr, exprpos, charpos, buff, buffpos);
/** * <p> Finds and precompiles the wildcard patterns from the ActionConfig * "path" attributes. ActionConfig's will be evaluated in the order they * exist in the config file. Only paths that actually contain a * wildcard will be compiled. </p> * * <p>Patterns can optionally be matched "loosely". When * the end of the pattern matches \*[^*]\*$ (wildcard, no wildcard, * wildcard), if the pattern fails, it is also matched as if the * last two characters didn't exist. The goal is to support the * legacy "*!*" syntax, where the "!*" is optional.</p> * * @param configs An array of ActionConfig's to process * @param looseMatch To loosely match wildcards or not * @deprecated Since 2.1, use {@link #ActionConfigMatcher(PatternMatcher, Map, boolean)} instead */ @Deprecated public ActionConfigMatcher(Map<String, ActionConfig> configs, boolean looseMatch) { this(new WildcardHelper(), configs, looseMatch); }
WildcardHelper wildcard = new WildcardHelper(); String methodCopy ; if (method == null ) { // no method specified int[] compiledPattern = wildcard.compilePattern(pattern); HashMap<String,String> matchedPatterns = new HashMap<String, String>(); boolean matches = wildcard.match(matchedPatterns, methodCopy, compiledPattern); if (matches) { return true; // run it, includeMethods takes precedence int[] compiledPattern = wildcard.compilePattern(pattern); HashMap<String,String> matchedPatterns = new HashMap<String, String>(); boolean matches = wildcard.match(matchedPatterns, methodCopy, compiledPattern); if (matches) {