net.anotheria.anoprise.metafactory.OnTheFlyResolver Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ano-prise Show documentation
Show all versions of ano-prise Show documentation
Collection of utils for different enterprise class projects. Among other stuff contains
Caches, Mocking, DualCrud, MetaFactory and SessionDistributorService. Visit https://opensource.anotheria.net for details.
package net.anotheria.anoprise.metafactory;
import org.reflections.Reflections;
import org.reflections.scanners.SubTypesScanner;
import org.reflections.util.ClasspathHelper;
import org.reflections.util.ConfigurationBuilder;
import org.reflections.util.FilterBuilder;
import java.util.Collection;
/**
* TODO comment this class
*
* @author lrosenberg
* @since 12.12.12 14:51
*/
public class OnTheFlyResolver {
public static Collection> resolveOnTheFly(Class interfaceClass){
Reflections reflections = new Reflections(
new ConfigurationBuilder()
.filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(interfaceClass.getPackage().getName())))
.setUrls(ClasspathHelper.forPackage(interfaceClass.getPackage().getName()))
.setScanners(new SubTypesScanner())
);
return reflections.getSubTypesOf(interfaceClass);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy