本文整理汇总了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());
}
示例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);
}
示例3: createEmptyResource
import org.hawk.emfresource.impl.LocalHawkResourceImpl; //导入依赖的package包/类
protected LocalHawkResourceImpl createEmptyResource(URI uri) {
return new LocalHawkResourceImpl(uri, null, true, Arrays.asList("*"), Arrays.asList("*"));
}