本文整理汇总了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);
}