Package org.reflections.util

Examples of org.reflections.util.ConfigurationBuilder


        .forClassLoader())) {
      if (url.toString().toLowerCase().endsWith(".jar")) {
        urls.add(url);
      }
    }
    this.reflections = new Reflections(new ConfigurationBuilder()
        .setScanners(new TypeAnnotationsScanner())
        .setUrls(ClasspathHelper.forPackage("")).addUrls(urls));
  }
View Full Code Here


     * @param router
     */
    @Override
    public void init(Router router) {

        ConfigurationBuilder builder = new ConfigurationBuilder();

        Set<URL> packagesToScan = getPackagesToScanForRoutes();
        builder.addUrls(packagesToScan);

        builder.addScanners(new MethodAnnotationsScanner());
        Reflections reflections = new Reflections(builder);

        // collect the allowed annotated methods
        Map<Class<?>, Set<String>> controllers = Maps.newHashMap();
        List<Method> methods = Lists.newArrayList();
View Full Code Here

     *
     * @param router at add the routes to
     */
    public void addAnnotatedRoutes(Router router) {
       
        ConfigurationBuilder builder = new ConfigurationBuilder();
       
        Set<URL> packagesToScan = getPackagesToScanForRoutes(ninjaProperties);
        builder.addUrls(packagesToScan);
       
        builder.addScanners(new MethodAnnotationsScanner());
        Reflections reflections = new Reflections(builder);

        Set<Method> methods = reflections.getMethodsAnnotatedWith(Route.class);

        logger.info("Generating {} routes.", methods.size());
View Full Code Here

    public static DataModelScanner createDefault() {
        return new DataModelScanner().withCaffinitasPersistenceXml();
    }

    public DataModelScanner() {
        configurationBuilder = new ConfigurationBuilder();
    }
View Full Code Here

    return map;
  }

  private static Reflections getReflections() {
    if (REFLECTIONS == null) {
      REFLECTIONS = new Reflections(new ConfigurationBuilder().setUrls(getMarkedPaths()).setScanners(subTypeScanner, annotationsScanner, resourcesScanner));
    }
    return REFLECTIONS;
  }
View Full Code Here

                // last to use the given namespace
                myNameSpaceToScan = namespaceToScan;
            }

            if (!Strings.isNullOrEmpty(myNameSpaceToScan)) {
                final Reflections reflections = new Reflections(new ConfigurationBuilder().filterInputsBy(
                            new FilterBuilder.Include(FilterBuilder.prefix(myNameSpaceToScan))).setUrls(
                            ClasspathHelper.forPackage(myNameSpaceToScan)).setScanners(new TypeAnnotationsScanner()
                                .filterResultsBy(filter)));
                final Set<Class<?>> typesAnnotatedWith = reflections.getTypesAnnotatedWith(
                        GlobalValueTransformer.class);
View Full Code Here

      throw new RuntimeException("Error getting JDBC connection", e);
    }
  }

  private static InputStream getInputStreamFromFile(String file) {
    Reflections reflections = new Reflections(new ConfigurationBuilder()
        .addUrls(ClasspathHelper.forPackage("org.pau.assetmanager"))
        .setScanners(new ResourcesScanner()));
    Set<String> resources = reflections.getResources(Pattern.compile(file));
    if (resources.size() > 0) {
      String resourceFound = resources.iterator().next().toString();
View Full Code Here

      // Check if there are complements via annotations
      if (d.getPackagesToScan() != null) {
        for (String pack : d.getPackagesToScan()) {
          Reflections reflections = new Reflections(
              new ConfigurationBuilder()
                  .setUrls(ClasspathHelper.forPackage(pack))
                  .setScanners(new MethodAnnotationsScanner()));

          Set<Method> annotated = reflections
              .getMethodsAnnotatedWith(Documentation.class);
View Full Code Here

    }

    ClassLoader newClassLoader = new URLClassLoader(new URL[]{instanceURL}, Thread.currentThread().getContextClassLoader());
    Thread.currentThread().setContextClassLoader(newClassLoader);

    Reflections reflections = new Reflections(new ConfigurationBuilder()
          .addUrls(instanceURL, ClasspathHelper.forClass(com.crawljax.core.plugin.Plugin.class))
          .addClassLoader(newClassLoader));

    Set<Class<? extends com.crawljax.core.plugin.Plugin>> pluginClasses = reflections.getSubTypesOf(com.crawljax.core.plugin.Plugin.class);
    pluginClasses.removeAll(basePluginClasses);
View Full Code Here

            }
        };

        final String myNameSpaceToScan = getNameSpace();

        final Reflections reflections = new Reflections(new ConfigurationBuilder().filterInputsBy(
                    new FilterBuilder.Include(FilterBuilder.prefix(myNameSpaceToScan))).setUrls(
                    ClasspathHelper.forPackage(myNameSpaceToScan)).setScanners(new TypeAnnotationsScanner()
                        .filterResultsBy(filter)));
        final Set<Class<?>> objectMapper = reflections.getTypesAnnotatedWith(GlobalObjectMapper.class);
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.