Ejemplo n.º 1
0
  /**
   * constructs a Reflections instance and scan according to given {@link Configuration}
   *
   * <p>it is preferred to use {@link org.jboss.errai.reflections.util.ConfigurationBuilder}
   */
  public Reflections(final Configuration configuration) {
    this.configuration = configuration;
    store = new Store(configuration);

    // inject to scanners
    for (Scanner scanner : configuration.getScanners()) {
      scanner.setConfiguration(configuration);
      scanner.setStore(store.get(scanner));
    }
  }
Ejemplo n.º 2
0
 private void scan(Vfs.File file) {
   String input = file.getRelativePath();
   if (configuration.acceptsInput(input)) {
     for (Scanner scanner : configuration.getScanners()) {
       try {
         if (scanner.acceptsInput(input)) {
           scanner.scan(file);
         }
       } catch (Exception e) {
         log.warn(
             "could not scan file " + file.getFullPath() + " with scanner " + scanner.getName(),
             e);
       }
     }
   }
 }