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


Java LocalHawkResourceImpl类代码示例

本文整理汇总了Java中org.hawk.emfresource.impl.LocalHawkResourceImpl的典型用法代码示例。如果您正苦于以下问题:Java LocalHawkResourceImpl类的具体用法?Java LocalHawkResourceImpl怎么用?Java LocalHawkResourceImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getResource

import org.hawk.emfresource.impl.LocalHawkResourceImpl; //导入依赖的package包/类
protected HawkResource getResource()
{
	return new LocalHawkResourceImpl(URI.createURI("hawk://"), 
			getHawkModel().getIndexer(), false, 
			Collections.singletonList(request.getRepositoryPattern()),
			request.getFilePatterns());
}
 
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:8,代码来源:IFCExportJobExecutor.java

示例2: createResource

import org.hawk.emfresource.impl.LocalHawkResourceImpl; //导入依赖的package包/类
@Override
public Resource createResource(URI uri) {
	String hawkInstance;
	boolean isSplit = true;
	List<String> repoPatterns = Arrays.asList("*");
	List<String> filePatterns = repoPatterns;

	if ("hawk+local".equals(uri.scheme())) {
		hawkInstance = uri.host();
	} else {
		final String filePath = CommonPlugin.resolve(uri).toFileString();
		if (filePath == null) {
			Activator.logWarn("Could not resolve " + uri + " into a file: returning an empty resource");
			return createEmptyResource(uri);
		}
		try (final BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), FILE_ENCODING))) {
			hawkInstance = br.readLine();

			String optionLine;
			while ((optionLine = br.readLine()) != null) {
				optionLine = optionLine.trim();
				String[] parts = optionLine.split(KEYVAL_SEPARATOR, 2);
				if (parts.length == 1 && parts[0].equals(OPTION_UNSPLIT)) {
					isSplit = false;
				} else if (parts.length == 2 && parts[0].equals(OPTION_RPATTERNS)) {
					repoPatterns = Arrays.asList(parts[1].split(PATTERN_SEPARATOR));
				} else if (parts.length == 2 && parts[0].equals(OPTION_FPATTERNS)) {
					filePatterns = Arrays.asList(parts[1].split(PATTERN_SEPARATOR));
				}
			}
		} catch (IOException e) {
			Activator.logError("Could not read " + filePath, e);
			return createEmptyResource(uri);
		}
	}

	final HUIManager manager = HUIManager.getInstance();
	final HModel hawkModel = manager.getHawkByName(hawkInstance);
	if (hawkModel == null) {
		return createEmptyResource(uri);
	}
	if (!hawkModel.isRunning()) {
		hawkModel.start(manager);
	}
	return new LocalHawkResourceImpl(uri, hawkModel.getIndexer(), isSplit, repoPatterns, filePatterns);
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:47,代码来源:LocalHawkResourceFactoryImpl.java

示例3: createEmptyResource

import org.hawk.emfresource.impl.LocalHawkResourceImpl; //导入依赖的package包/类
protected LocalHawkResourceImpl createEmptyResource(URI uri) {
	return new LocalHawkResourceImpl(uri, null, true, Arrays.asList("*"), Arrays.asList("*"));
}
 
开发者ID:mondo-project,项目名称:mondo-hawk,代码行数:4,代码来源:LocalHawkResourceFactoryImpl.java


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