本文整理匯總了Java中org.reflections.util.ConfigurationBuilder.addClassLoader方法的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationBuilder.addClassLoader方法的具體用法?Java ConfigurationBuilder.addClassLoader怎麽用?Java ConfigurationBuilder.addClassLoader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.reflections.util.ConfigurationBuilder
的用法示例。
在下文中一共展示了ConfigurationBuilder.addClassLoader方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureReflection
import org.reflections.util.ConfigurationBuilder; //導入方法依賴的package包/類
private static Reflections configureReflection(Bundle bundle, ClassLoader classLoader, Scanner... scanners) {
ConfigurationBuilder configuration = new ConfigurationBuilder();
configuration.addUrls(resolveLocation(bundle));
configuration.setScanners(scanners);
// we add the ability to load classes from the bundle
configuration.addClassLoader(classLoader);
LOGGER.debug("Initialized Reflections configuration");
return new Reflections(configuration);
}
示例2: getReflections
import org.reflections.util.ConfigurationBuilder; //導入方法依賴的package包/類
public Reflections getReflections() {
if (reflections == null) {
URL url = getModClasspathUrl();
if (url != null) {
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().addUrls(url).setScanners(new TypeAnnotationsScanner(), new SubTypesScanner());
if (activeClassLoader != null) {
configurationBuilder.addClassLoader(activeClassLoader);
} else {
configurationBuilder.addClassLoader(inactiveClassLoader);
}
reflections = new Reflections(configurationBuilder);
}
}
return reflections;
}
示例3: AnnotationTypeLoader
import org.reflections.util.ConfigurationBuilder; //導入方法依賴的package包/類
public AnnotationTypeLoader(TypeLoader<T> parent, ClassLoader classLoader) {
this.parent = parent;
builder = new ConfigurationBuilder();
builder.addClassLoader(classLoader);
}