Package org.reflections.util

Examples of org.reflections.util.ConfigurationBuilder


      URL url = urlIter.next();
      if(url.toString().toLowerCase().endsWith(".jar") || !url.toString().toLowerCase().contains(".")) {
        urls.add(url);
      }
    }
    Reflections ref = new Reflections(new ConfigurationBuilder().setUrls(urls));
    for(Class<?> clazz: ref.getTypesAnnotatedWith(URIHandler.class)) {
      if(PipelineModifier.class.isAssignableFrom(clazz)) {
        URIHandler uhandler = clazz.getAnnotation(URIHandler.class);
        try {
          PipelineModifier pm = (PipelineModifier)clazz.newInstance();
View Full Code Here


    private final List<OnStartListener> onStartListeners = new CopyOnWriteArrayList<OnStartListener>();
    private final List<OnStopListener> onStopListeners = new CopyOnWriteArrayList<OnStopListener>();

    @Override
    public void beforeStart(final Application application) {
        final Reflections reflections = new Reflections(new ConfigurationBuilder()
                .filterInputsBy(new FilterBuilder.Exclude(FilterBuilder.prefix("com.google")))
                .addUrls(ClasspathHelper.forClassLoader(application.classloader()))
                .addScanners(
                        new SubTypesScanner()
                ));
View Full Code Here

      URL url = urlIter.next();
      if(url.toString().toLowerCase().endsWith(".jar")) {
        urls.add(url);
      }
    }
    Reflections ref = new Reflections(new ConfigurationBuilder().setUrls(urls));
    for(Class<? extends ChannelHandler> clazz: ref.getSubTypesOf(ChannelHandler.class)) {
      if(Modifier.isAbstract(clazz.getModifiers())) continue;
      ChannelHandler.Sharable shareable = clazz.getAnnotation(ChannelHandler.Sharable.class);
      if(shareable==null) {
        notSharable.add(clazz);
View Full Code Here

    super(getConfiguration(urls));
    scan();
  }

  private static Configuration getConfiguration(List<URL> urls) {
    return new ConfigurationBuilder()
            .setUrls(urls)
                    //.filterInputsBy(new FilterBuilder().exclude(CLIENT_PKG_REGEX))
            .setScanners(
                    new FieldAnnotationsScanner(),
                    new MethodAnnotationsScanner(),
View Full Code Here

     * @return Classes
     */
    public Iterable<Class<?>> allTypes() {
        return Iterables.filter(
            new Reflections(
                new ConfigurationBuilder()
                    .setScanners(
                        new SubTypesScanner(false),
                        new ResourcesScanner()
                )
                    .setUrls(
View Full Code Here

     */
    public static Set<Class<? extends Structure>> findSubTypesOfStructure(final Class classDeclaredInSourceTreeToSearch) {

        // use: http://code.google.com/p/reflections/

        final Reflections reflections = new Reflections(new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
                .setUrls(ClasspathHelper.forClass(classDeclaredInSourceTreeToSearch))
        );

        return reflections.getSubTypesOf(Structure.class);
View Full Code Here

    }
  }

  private static Configuration getConfiguration(List<URL> urls) {

    return new ConfigurationBuilder()
            .setUrls(urls)
            .setScanners(
                    new FieldAnnotationsScanner(),
                    new MethodAnnotationsScanner(),
                    new TypeAnnotationsScanner() {
View Full Code Here

            URL url = cpFile.toURL();
            urls.add(url);
        }

        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setUrls(urls);
        configurationBuilder.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner());

        ReflectionsExt refl = new ReflectionsExt(configurationBuilder);

        Collection<Class<?>> allClasses = Sets.newHashSet();
        addAnnotatedClasses(ResourceDependencies.class, refl, allClasses);
View Full Code Here

            URL url = cpFile.toURL();
            urls.add(url);
        }

        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().setUrls(urls);
        configurationBuilder.setScanners(new SubTypesScanner(), new TypeAnnotationsScanner(), new MarkerResourcesScanner());

        ReflectionsExt refl = new ReflectionsExt(configurationBuilder);
        Collection<Class<?>> allClasses = Sets.newHashSet();

        addAnnotatedClasses(DynamicUserResource.class, refl, allClasses);
View Full Code Here

     
      CtClass mainclas = cp.makeClass("org.zkoss.zkplus.cdi.ZKComponentProducerMethods");
      final List<URL> l = getUrlsForCurrentClasspath();
     
      Reflections reflections = new Reflections(
          new ConfigurationBuilder().setUrls(l)
          .setScanners(new FieldAnnotationsScanner()));
     
      Set<Field> fields = reflections.getFieldsAnnotatedWith(ComponentId.class);
      for (Iterator iterator2 = fields.iterator(); iterator2
          .hasNext();) {
View Full Code Here

TOP

Related Classes of org.reflections.util.ConfigurationBuilder

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.