Class FilterBuilder
For example:
Predicatefilter1 = FilterBuilder.parsePackages("-java, "-javax"); Predicate filter2 = new FilterBuilder().include(".*").exclude("java.*");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd a Predicate to the chain of predicatesexclude a regular expressionexcludePackage(Class<?> aClass) exclude a package of a given classexcludePackage(String prefix) exclude a package of a given prefixinclude a regular expressionincludePackage(Class<?> aClass) include a package of a given classincludePackage(String... prefixes) include packages of given prefixesprivate static StringpackageNameRegex(Class<?> aClass) static FilterBuilderParses a string representation of an include/exclude filter.static FilterBuilderparsePackages(String includeExcludeString) Parses a string representation of an include/exclude filter.static StringbooleantoString()
-
Field Details
-
chain
-
-
Constructor Details
-
FilterBuilder
public FilterBuilder() -
FilterBuilder
-
-
Method Details
-
include
include a regular expression -
exclude
exclude a regular expression -
add
add a Predicate to the chain of predicates -
includePackage
include a package of a given class -
excludePackage
exclude a package of a given class -
includePackage
include packages of given prefixes -
excludePackage
exclude a package of a given prefix -
packageNameRegex
-
prefix
-
toString
-
test
-
parse
Parses a string representation of an include/exclude filter.The given includeExcludeString is a comma separated list of regexes, each starting with either + or - to indicate include/exclude.
For example parsePackages("-java\\..*, -javax\\..*, -sun\\..*, -com\\.sun\\..*") or parse("+com\\.myn\\..*,-com\\.myn\\.excluded\\..*"). Note that "-java\\..*" will block "java.foo" but not "javax.foo".
See also the more useful
parsePackages(String)method. -
parsePackages
Parses a string representation of an include/exclude filter.The given includeExcludeString is a comma separated list of package name segments, each starting with either + or - to indicate include/exclude.
For example parsePackages("-java, -javax, -sun, -com.sun") or parse("+com.myn,-com.myn.excluded"). Note that "-java" will block "java.foo" but not "javax.foo".
The input strings "-java" and "-java." are equivalent.
-