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

net.anotheria.anoprise.metafactory.OnTheFlyResolver Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.0
Show newest version
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