org.reflections.util

Class FilterBuilder

  • All Implemented Interfaces:
    com.google.common.base.Predicate<String>


    public class FilterBuilderextends Objectimplements com.google.common.base.Predicate<String>
    Builds include/exclude filters for Reflections.

    For example:

     Predicate filter1 = FilterBuilder.parsePackages("-java, "-javax"); Predicate filter2 = new FilterBuilder().include(".*").exclude("java.*"); 

    • Constructor Detail

      • FilterBuilder

        public FilterBuilder()
    • Method Detail

      • add

        public FilterBuilder add(com.google.common.base.Predicate<String> filter)
        add a Predicate to the chain of predicates
      • includePackage

        public FilterBuilder includePackage(Class<?> aClass)
        include a package of a given class
      • excludePackage

        public FilterBuilder excludePackage(Class<?> aClass)
        exclude a package of a given class
      • includePackage

        public FilterBuilder includePackage(String... prefixes)
        include packages of given prefixes
      • excludePackage

        public FilterBuilder excludePackage(String prefix)
        exclude a package of a given prefix
      • apply

        public boolean apply(String regex)
        Specified by:
        apply in interface com.google.common.base.Predicate<String>
      • parse

        public static FilterBuilder parse(String includeExcludeString)
        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

        public static FilterBuilder parsePackages(String includeExcludeString)
        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.

Copyright © 2015. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14