當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。