本文整理匯總了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("*"));
}