All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xapi.dev.scanner.api.ClasspathScanner Maven / Gradle / Ivy

Go to download

Everything needed to run a comprehensive dev environment. Just type X_ and pick a service from autocomplete; new dev modules will be added as they are built. The only dev service not included in the uber jar is xapi-dev-maven, as it includes all runtime dependencies of maven, adding ~4 seconds to build time, and 6 megabytes to the final output jar size (without xapi-dev-maven, it's ~1MB).

The newest version!
package xapi.dev.scanner.api;

import java.lang.annotation.Annotation;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;

import xapi.dev.scanner.impl.ClasspathResourceMap;

/**
 * Most runtime annotation scanner libraries are too heavyweight;
 * they try to do too much.  Though great tools, we want flyweight and fast.
 *
 * This service is based on org.reflections:reflections,
 * except we are doing much less,
 * and using an api that will enable multi-threaded scanning,
 * using a work-stealing algorithm to fill in a PackageTrie.
 *
 * @author "James X. Nelson ([email protected])"
 *
 */
public interface ClasspathScanner {

  ClasspathScanner scanPackage(String pkg);
  ClasspathScanner scanPackages(String ... pkgs);
  ClasspathScanner scanAnnotation(Class annotations);
  ClasspathScanner scanAnnotations(@SuppressWarnings("unchecked") Class ... annotations);
  ClasspathScanner matchClassFile(String regex);
  ClasspathScanner matchClassFiles(String ... regex);
  ClasspathScanner matchSourceFile(String regex);
  ClasspathScanner matchSourceFiles(String ... regex);
  ClasspathScanner matchResource(String regex);
  ClasspathScanner matchResources(String ... regex);

  ClasspathResourceMap scan(ClassLoader loader);
  Callable scan(ClassLoader loader, ExecutorService executor);
  ExecutorService newExecutor();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy