Package org.reflections.scanners

Examples of org.reflections.scanners.SubTypesScanner


      cfgBldr.addUrls(ClasspathHelper.forPackage(basePkg));
      filterBuilder.include(FilterBuilder.prefix(basePkg));
    }

    cfgBldr.filterInputsBy(filterBuilder).setScanners(
        new SubTypesScanner(), new TypeAnnotationsScanner());
    this.reflections = new Reflections(cfgBldr);
  }
View Full Code Here


      }
      if(config.getBasePackages().length > 1) {
        throw new IllegalArgumentException("picoprovider has no support for multiple package scanning");
      }
      String packages = config.getBasePackages()[0];
        this.reflections = new Reflections(packages, new ClassAnnotationsScanner(), new SubTypesScanner());
    }
View Full Code Here

            reflections = defaultReflections;
        } else {
            addClasspath(classpath);
            reflections = new Reflections( new ConfigurationBuilder()
                .setUrls(classpath)
                .setScanners(new SubTypesScanner()));
        }

        // Load all classes types filtering them by concrete.
        @SuppressWarnings("unchecked")
        Set<Class<? extends PluginType>> allTypes = reflections.getSubTypesOf(pluginType);
View Full Code Here

    /*lazy*/ private Serializer serializer;
    private ExecutorService executorService;
    /*@Nullable*/ private ClassLoader[] classLoaders;

    public ConfigurationBuilder() {
        scanners = Sets.<Scanner>newHashSet(new TypeAnnotationsScanner(), new SubTypesScanner());
        urls = Sets.newHashSet();
    }
View Full Code Here

            return new Class[]{BooleanTest.class};
        }
        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(new FilterBuilder().includePackage("be.pw999.jape.tests.impl"))
                .setUrls(ClasspathHelper.forPackage("be.pw999.jape.tests.impl"))
                .setScanners(new SubTypesScanner())
        );
        Set<Class<? extends ITest>> allClasses = reflections.getSubTypesOf(ITest.class);
        Set<Class<? extends ITest>> classes = new HashSet<Class<? extends ITest>>();
        for (Class<? extends ITest> clazz : allClasses) {
            if ((clazz.getModifiers() & Modifier.ABSTRACT) == 0) {
View Full Code Here

    if (name.charAt(dot + 1) == '*') {
      List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
      classLoadersList.add(ClasspathHelper.contextClassLoader());
      classLoadersList.add(ClasspathHelper.staticClassLoader());
     
      Reflections reflections = new Reflections(new ConfigurationBuilder().setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
          .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0]))).filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(name.substring(0, dot)))));
      Set<Class<?>> classes = reflections.getSubTypesOf(Object.class);
      for (Class<?> clazz : classes) {
        name = clazz.getName();
        dot = name.lastIndexOf('.');
View Full Code Here

                Constants.DISCONF_PACK_NAME).includePackage(packName);

        //
        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(filter)
                .setScanners(new SubTypesScanner().filterResultsBy(filter),
                        new TypeAnnotationsScanner().filterResultsBy(filter),
                        new FieldAnnotationsScanner().filterResultsBy(filter),
                        new MethodAnnotationsScanner().filterResultsBy(filter),
                        new MethodParameterScanner())
                .setUrls(ClasspathHelper.forPackage(packName)));
View Full Code Here

        List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
        classLoadersList.add(ClasspathHelper.contextClassLoader());
        classLoadersList.add(ClasspathHelper.staticClassLoader());

        ConfigurationBuilder configuration = new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false), new ResourcesScanner())
                .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[classLoadersList.size()])))
                .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(inputPackage)));

        Reflections reflections = new Reflections(configuration);
View Full Code Here

        List<ClassLoader> classLoadersList = new LinkedList<ClassLoader>();
        classLoadersList.add(ClasspathHelper.contextClassLoader());
        classLoadersList.add(ClasspathHelper.staticClassLoader());

        ConfigurationBuilder configuration = new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false), new ResourcesScanner())
                .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[classLoadersList.size()])))
                .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(inputPackage)));

        Reflections reflections = new Reflections(configuration);
View Full Code Here

      cfgBldr.addUrls(ClasspathHelper.forPackage(basePkg));
      filterBuilder.include(FilterBuilder.prefix(basePkg));
    }

    cfgBldr.filterInputsBy(filterBuilder).setScanners(
        new SubTypesScanner(), new TypeAnnotationsScanner());
    this.reflections = new Reflections(cfgBldr);
  }
View Full Code Here

TOP

Related Classes of org.reflections.scanners.SubTypesScanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.