protected boolean add(Entry entry) { if (_entries.containsKey(entry.getPattern())) return false; _entries.put(entry.getPattern(),entry); if (entry instanceof LocationEntry || entry instanceof ModuleEntry) { if (entry.isInclusive()) _locations.include(entry); else _locations.exclude(entry); } else { if (entry.isInclusive()) _patterns.include(entry); else _patterns.exclude(entry); } return true; }
/** * Match the class name against the pattern * * @param name name of the class to match * @return true if class matches the pattern */ public boolean match(String name) { return _patterns.test(name); }
Boolean byName = _patterns.isIncludedAndNotExcluded(name); if (Boolean.FALSE.equals(byName)) return byName; // Already excluded so no need to check location. if ("file".equalsIgnoreCase(jarUri.getScheme())) byLocation = _locations.isIncludedAndNotExcluded(jarUri); || (byName==null && !_patterns.hasIncludes() && byLocation==null && !_locations.hasIncludes()); boolean excluded = Boolean.FALSE.equals(byName) || Boolean.FALSE.equals(byLocation); return included && !excluded;
/** * Add an exclude PathMatcher * * @param matcher * the path matcher for this exclude */ public void addExclude(PathMatcher matcher) { includeExclude.exclude(matcher); }
/** * Add an include PathMatcher * * @param matcher * the path matcher for this include */ public void addInclude(PathMatcher matcher) { includeExclude.include(matcher); }
public Config(Path path, Config parent) { this.parent = parent; this.includeExclude = parent==null ? new IncludeExcludeSet<>(PathMatcherSet.class) : parent.includeExclude; Path dir = path; if (!Files.exists(path)) throw new IllegalStateException("Path does not exist: "+path); if (!Files.isDirectory(path)) { dir = path.getParent(); includeExclude.include(new ExactPathMatcher(path)); setRecurseDepth(0); } this.path = dir; }
@Override public void dump(Appendable out, String indent) throws IOException { dumpBeans(out,indent,_set.getIncluded(),_set.getExcluded()); } }
/** * Excludes an InetAddress pattern * * @param pattern InetAddress pattern to exclude * @see InetAddressSet */ public void exclude(String pattern) { _set.exclude(pattern); }
/** * Include a InetAddress pattern * @see InetAddressSet * @param pattern InetAddress pattern to exclude */ public void include(String pattern) { _set.include(pattern); }
public Config(Path path, Config parent) { this.parent = parent; this.includeExclude = parent==null ? new IncludeExcludeSet<>(PathMatcherSet.class) : parent.includeExclude; Path dir = path; if (!Files.exists(path)) throw new IllegalStateException("Path does not exist: "+path); if (!Files.isDirectory(path)) { dir = path.getParent(); includeExclude.include(new ExactPathMatcher(path)); setRecurseDepth(0); } this.path = dir; }
Boolean byName = _patterns.isIncludedAndNotExcluded(clazz.getName()); if (Boolean.FALSE.equals(byName)) return byName; // Already excluded so no need to check location. URI location = TypeUtil.getLocationOfClass(clazz); Boolean byLocation = location == null ? null : _locations.isIncludedAndNotExcluded(location); || (byName==null && !_patterns.hasIncludes() && byLocation==null && !_locations.hasIncludes()); boolean excluded = Boolean.FALSE.equals(byName) || Boolean.FALSE.equals(byLocation); return included && !excluded;
@Override public void dump(Appendable out, String indent) throws IOException { dumpBeans(out, indent, _set.getIncluded(), _set.getExcluded()); } }
@Deprecated public boolean matches(P t) { return test(t); }
protected boolean add(Entry entry) { if (_entries.containsKey(entry.getPattern())) return false; _entries.put(entry.getPattern(),entry); if (entry instanceof LocationEntry || entry instanceof ModuleEntry) { if (entry.isInclusive()) _locations.include(entry); else _locations.exclude(entry); } else { if (entry.isInclusive()) _patterns.include(entry); else _patterns.exclude(entry); } return true; }
/** * Exclude a InetAddress pattern * @see InetAddressSet * @param pattern InetAddress pattern to exclude */ public void exclude(String pattern) { _set.exclude(pattern); }
/** * Include a InetAddress pattern * @see InetAddressSet * @param patterns InetAddress patterns to exclude */ public void include(String... patterns) { _set.include(patterns); }
Boolean byName = _patterns.isIncludedAndNotExcluded(name); if (Boolean.FALSE.equals(byName)) return byName; // Already excluded so no need to check location. if ("file".equalsIgnoreCase(jarUri.getScheme())) byLocation = _locations.isIncludedAndNotExcluded(jarUri); || (byName==null && !_patterns.hasIncludes() && byLocation==null && !_locations.hasIncludes()); boolean excluded = Boolean.FALSE.equals(byName) || Boolean.FALSE.equals(byLocation); return included && !excluded;