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

ru.curs.celesta.java.AnnotationScanner Maven / Gradle / Ivy

There is a newer version: 6.1.12
Show newest version
package ru.curs.celesta.java;

import org.reflections.Reflections;
import org.reflections.scanners.MethodAnnotationsScanner;
import ru.curs.celesta.java.annotation.CelestaProc;

import java.lang.reflect.Method;
import java.util.Set;
import java.util.stream.Collectors;

final class AnnotationScanner {

    static Set scan(Set scanningPackages) {
        return scanningPackages.stream()
                .map(AnnotationScanner::scan)
                .flatMap(Set::stream)
                .collect(Collectors.toSet());
    }

    private static Set scan(String scanningPackage) {
        Reflections reflections = new Reflections(scanningPackage, new MethodAnnotationsScanner());
        return reflections.getMethodsAnnotatedWith(CelestaProc.class);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy