use of com.sun.jersey.core.spi.scanning.Scanner in project platformlayer by platformlayer.
the class JerseyAnnotationDiscovery method scan.
public void scan(URLClassLoader classLoader) {
Scanner scanner = buildScanner(classLoader);
AnnotationScannerListener listener = new AnnotationScannerListener(ANNOTATIONS);
scanner.scan(listener);
for (Class<?> clazz : listener.getAnnotatedClasses()) {
for (Class<? extends Annotation> annotation : ANNOTATIONS) {
if (clazz.isAnnotationPresent(annotation)) {
AnnotationDictionary annotationDictionary = getAnnotationDictionary(annotation);
annotationDictionary.add(clazz);
}
}
}
}
use of com.sun.jersey.core.spi.scanning.Scanner in project platformlayer by platformlayer.
the class JerseyAnnotationDiscovery method buildScanner.
private Scanner buildScanner(URLClassLoader classLoader) {
List<File> paths = Lists.newArrayList();
for (URL url : classLoader.getURLs()) {
if (!"file".equals(url.getProtocol())) {
continue;
}
paths.add(new File(url.getFile()));
}
Scanner scanner = new FilesScanner(paths.toArray(new File[paths.size()]));
return scanner;
}
Aggregations