/** * Get the default filter used to determine included when searching * the transitive closure of all the dependencies. * Unless overridden, the default filter accepts all dependencies. * @return the default filter. */ public static Filter getDefaultFilter() { return DefaultFilter.instance(); }
/** * Get a filter which uses a regular expression on the target's class name * to determine if a dependency is of interest. * @param pattern the pattern used to match the target's class name * @return a filter for matching the target class name with a regular expression */ public static Filter getRegexFilter(Pattern pattern) { return new TargetRegexFilter(pattern); }
/** * Get a filter which checks the package of a target's class name * to determine if a dependency is of interest. The filter checks if the * package of the target's class matches any of a set of given package * names. The match may optionally match subpackages of the given names as well. * @param packageNames the package names used to match the target's class name * @param matchSubpackages whether or not to match subpackages as well * @return a filter for checking the target package name against a list of package names */ public static Filter getPackageFilter(Set<String> packageNames, boolean matchSubpackages) { return new TargetPackageFilter(packageNames, matchSubpackages); }
/** * Get the filter used to determine the dependencies included when searching * the transitive closure of all the dependencies. * Unless overridden, the default filter accepts all dependencies. * @return the filter */ public Filter getFilter() { if (filter == null) filter = getDefaultFilter(); return filter; }
/** * Set the filter used to determine the dependencies included when searching * the transitive closure of all the dependencies. * @param f the filter */ public void setFilter(Filter f) { f.getClass(); // null check filter = f; }
/** * Set the filter used to determine the dependencies included when searching * the transitive closure of all the dependencies. * @param f the filter */ public void setFilter(Filter f) { filter = Objects.requireNonNull(f); }