当前位置: 首页>>代码示例>>Java>>正文


Java FilterBuilder.includePackage方法代码示例

本文整理汇总了Java中org.reflections.util.FilterBuilder.includePackage方法的典型用法代码示例。如果您正苦于以下问题:Java FilterBuilder.includePackage方法的具体用法?Java FilterBuilder.includePackage怎么用?Java FilterBuilder.includePackage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.reflections.util.FilterBuilder的用法示例。


在下文中一共展示了FilterBuilder.includePackage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ReflectionsServiceDiscovery

import org.reflections.util.FilterBuilder; //导入方法依赖的package包/类
public ReflectionsServiceDiscovery(String resourceSearchPackages, JsonServiceLocator locator) {
	this.locator = locator;

	ConfigurationBuilder builder = new ConfigurationBuilder();

	PreconditionUtil.assertNotNull("no resourceSearchPackage configured", resourceSearchPackages);

	FilterBuilder filter = new FilterBuilder();
	for (String resourceSearchPackage : resourceSearchPackages.split(",")) {
		builder = builder.addUrls(ClasspathHelper.forPackage(resourceSearchPackage));
		filter.includePackage(resourceSearchPackage);
	}
	filter.includePackage(Repository.class.getPackage().getName());
	filter.includePackage(ResourceRepository.class.getPackage().getName());
	builder = builder.filterInputsBy(filter);

	builder = builder.addUrls(ClasspathHelper.forClass(Repository.class));
	builder = builder.addUrls(ClasspathHelper.forClass(ResourceRepository.class));
	builder = builder.addUrls(ClasspathHelper.forClass(ResourceRepositoryV2.class));

	builder = builder.setScanners(new SubTypesScanner(false), new TypeAnnotationsScanner());
	reflections = new Reflections(builder);
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:24,代码来源:ReflectionsServiceDiscovery.java

示例2: scan

import org.reflections.util.FilterBuilder; //导入方法依赖的package包/类
public static ApiDocumentation scan(String version, String path, List<String> packages) {

		Set<URL> urls = new HashSet<URL>();
		FilterBuilder filter = new FilterBuilder();

		log.debug("Scanning {} package(s)...", packages.size());
		for(String pkg : packages) {
			urls.addAll(ClasspathHelper.forPackage(pkg));
			filter.includePackage(pkg);
		}

		Reflections reflections = new Reflections(new ConfigurationBuilder()
				.filterInputsBy(filter).setUrls(urls));

		ApiDocumentation apiDoc = new ApiDocumentation(version, path);
		apiDoc.setRepositories(scanApiRepository(reflections.getTypesAnnotatedWith
				(ApiRepository.class)));
		apiDoc.setModels(scanApiModel(reflections.getTypesAnnotatedWith
				(ApiModel.class)));
		return apiDoc;
	}
 
开发者ID:sebastian-ma,项目名称:tinyspring,代码行数:22,代码来源:ApiScanner.java


注:本文中的org.reflections.util.FilterBuilder.includePackage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。