use of io.github.lukehutch.fastclasspathscanner.matchprocessor.ClassAnnotationMatchProcessor in project uavstack by uavorg.
the class FastScanServlet method doGet.
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
FastClasspathScanner scanner = new FastClasspathScanner("com.creditease");
long st = System.nanoTime();
FastClasspathScanner scannerm1 = scanner.scan();
long end = System.nanoTime() - st;
System.out.println(end);
List<String> lista = scannerm1.getNamesOfClassesWithAnnotation(WebService.class);
for (String str : lista) {
System.out.println("webservice m1 -" + str);
}
st = System.nanoTime();
FastClasspathScanner scanner2 = new FastClasspathScanner("com.creditease");
scanner2.matchClassesWithAnnotation(WebService.class, new ClassAnnotationMatchProcessor() {
@SuppressWarnings("rawtypes")
@Override
public void processMatch(Class arg0) {
System.out.println("webservice m1 -" + arg0.getName());
}
}).scan();
end = System.nanoTime() - st;
System.out.println(end);
resp.getWriter().write("FastClasspathScanner cost:" + end);
}
Aggregations