本文整理汇总了Java中org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException类的典型用法代码示例。如果您正苦于以下问题:Java EolModelLoadingException类的具体用法?Java EolModelLoadingException怎么用?Java EolModelLoadingException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EolModelLoadingException类属于org.eclipse.epsilon.eol.exceptions.models包,在下文中一共展示了EolModelLoadingException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createEmfModel
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected EmfModel createEmfModel(Role role, String model)
throws FileNotFoundException, EolModelLoadingException,
URISyntaxException {
Language language = getLanguage(role);
assert language.getLocation() != null : String.format(
"Can't create EMF model for language %s", language);
StringProperties props = new StringProperties();
props.put(EmfModel.PROPERTY_NAME, role == BOTH ? "Model" : language.getName());
props.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI,
toFileURI(language.getLocation()));
props.put(EmfModel.PROPERTY_MODEL_URI, model);
props.put(EmfModel.PROPERTY_READONLOAD, "" + (role == SOURCE || role == BOTH));
props.put(EmfModel.PROPERTY_STOREONDISPOSAL, "" + (role == TARGET || role == BOTH));
EmfModel result = new EmfModel();
result.load(props, null);
return result;
}
示例2: contextlessQuery
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected Object contextlessQuery(IModelIndexer m, String query, Map<String, Object> context)
throws QueryExecutionException, InvalidQueryException {
final long trueStart = System.currentTimeMillis();
String defaultnamespaces = null;
if (context != null)
defaultnamespaces = (String) context.get(PROPERTY_DEFAULTNAMESPACES);
/*
* We need to always create a new engine for every query: reusing the
* same engine would be thread-unsafe.
*/
final EOLQueryEngine q = new EOLQueryEngine();
try {
q.load(m);
q.setDefaultNamespaces(defaultnamespaces);
} catch (EolModelLoadingException e) {
throw new QueryExecutionException("Loading of EOLQueryEngine failed");
}
final IEolModule module = createModule();
parseQuery(query, context, q, module);
return runQuery(trueStart, module);
}
示例3: contextfulQuery
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected Object contextfulQuery(IModelIndexer m, String query, Map<String, Object> context)
throws QueryExecutionException, InvalidQueryException {
final long trueStart = System.currentTimeMillis();
CEOLQueryEngine q = new CEOLQueryEngine();
try {
q.load(m);
} catch (EolModelLoadingException e) {
throw new QueryExecutionException("Loading of EOLQueryEngine failed");
}
q.setContext(context);
LOGGER.debug("Graph path: {}", graph.getPath());
final IEolModule module = createModule();
parseQuery(query, context, q, module);
return runQuery(trueStart, module);
}
示例4: createEmfModel
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected EmfModel createEmfModel(String name, String model,
String metamodel, boolean readOnLoad, boolean storeOnDisposal)
throws EolModelLoadingException, URISyntaxException {
EmfModel emfModel = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, name);
properties.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI,
getFile(metamodel).toURI().toString());
properties.put(EmfModel.PROPERTY_MODEL_URI,
getFile(model).toURI().toString());
properties.put(EmfModel.PROPERTY_READONLOAD, readOnLoad + "");
properties.put(EmfModel.PROPERTY_STOREONDISPOSAL,
storeOnDisposal + "");
emfModel.load(properties);
return emfModel;
}
示例5: createEmfModelByURI
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected EmfModel createEmfModelByURI(String name, String model, String metamodel,
boolean readOnLoad,
boolean storeOnDisposal) throws EolModelLoadingException {
// @Correctness this assumes the metamodels are in the EPackage.Registry.
// This does not hold for using Ecore files directly, unless we load them into
// the registry first.
// See if we can tell Epsilon to fallback on the Ecore file.
// @Correctness this condition seems fishy
if (metamodel.contains("UML")) {
UMLResourcesUtil.init(null);
}
EmfModel emfModel = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(Model.PROPERTY_NAME, name);
properties.put(EmfModel.PROPERTY_METAMODEL_URI, metamodel);
properties.put(EmfModel.PROPERTY_MODEL_URI, model);
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "false");
properties.put(Model.PROPERTY_READONLOAD, readOnLoad + "");
properties.put(Model.PROPERTY_STOREONDISPOSAL, storeOnDisposal + "");
emfModel.load(properties);
return emfModel;
}
示例6: getModels
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
public IModel[] getModels(String inputPath, String outputPath)
throws EolModelLoadingException, URISyntaxException, FileNotFoundException {
IModel source = createPlainXmlModel(Role.SOURCE, inputPath);
IModel target = createEmfModel(Role.TARGET, outputPath);
return new IModel[] { source, target };
}
示例7: getModels
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
public IModel[] getModels(String inputPath, String outputPath)
throws EolModelLoadingException, URISyntaxException, FileNotFoundException {
IModel source = createEmfModel(Role.SOURCE, inputPath);
IModel target = createPlainXmlModel(Role.TARGET, outputPath);
return new IModel[] { source, target };
}
示例8: createPlainXmlModel
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected PlainXmlModel createPlainXmlModel(Role role, String model)
throws FileNotFoundException, EolModelLoadingException,
URISyntaxException {
StringProperties props = new StringProperties();
props.put(PlainXmlModel.PROPERTY_NAME, getLanguage(role).getName());
props.put(PlainXmlModel.PROPERTY_URI, model);
props.put(PlainXmlModel.PROPERTY_READONLOAD, "" + (role == SOURCE));
props.put(PlainXmlModel.PROPERTY_STOREONDISPOSAL, "" + (role == TARGET));
PlainXmlModel result = new PlainXmlModel();
result.load(props, null);
return result;
}
示例9: loadModel
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
protected void loadModel() throws EolModelLoadingException {
loadModelFromUri();
this.hawkResource = (HawkResourceImpl) modelImpl;
if (hawkResource.getDescriptor().getLoadingMode().isGreedyElements()) {
/*
* Only set up the containment change listeners if we use the GREEDY
* or LAZY_ATTRIBUTES loading modes.
*/
setupContainmentChangeListeners();
}
}
示例10: load
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
public void load() throws EolModelLoadingException {
if (graph != null)
load((IModelIndexer) null);
else
throw new EolModelLoadingException(new Exception("load called with no graph store initialized"), this);
}
示例11: load
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
public void load(StringProperties properties, IRelativePathResolver resolver)
throws EolModelLoadingException {
this.name = properties.getProperty(Model.PROPERTY_NAME);
EOLQueryEngine eolQueryEngine = new EOLQueryEngine();
target = eolQueryEngine;
eolQueryEngine.setDatabaseConfig(properties);
//
database = HManager.getGraphByIndexerName(
properties.getProperty(PROPERTY_INDEXER_NAME));
// String location = properties.getProperty(PROPERTY_DATABASE_LOCATION);
//
// System.out.println("Location: " + location);
//
// String name = location.substring(location.lastIndexOf("/") + 1);
// String loc = location.substring(0, location.lastIndexOf("/"));
//
// System.out.println(name);
// System.out.println(loc);
//
// database.run(name, new File(loc), new DefaultConsole());
if(database!=null)
eolQueryEngine.load(database);
}
示例12: createEmfModelByURI
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected EmfModel createEmfModelByURI(String name, String modelURI,
String metamodelURI, boolean readOnLoad, boolean storeOnDisposal)
throws EolModelLoadingException, URISyntaxException {
EmfModel emfModel = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, name);
properties.put(EmfModel.PROPERTY_METAMODEL_URI, metamodelURI);
properties.put(EmfModel.PROPERTY_MODEL_URI, modelURI);
properties.put(EmfModel.PROPERTY_READONLOAD, readOnLoad + "");
properties.put(EmfModel.PROPERTY_STOREONDISPOSAL,
storeOnDisposal + "");
emfModel.load(properties);
return emfModel;
}
示例13: createXmlModel
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
protected XmlModel createXmlModel(String name, String uri, String xsdURI,
boolean readOnLoad, boolean storeOnDisposal)
throws EolModelLoadingException, URISyntaxException {
XmlModel xmlModel = new XmlModel();
StringProperties properties = new StringProperties();
properties.put(XmlModel.PROPERTY_NAME, name);
properties.put(XmlModel.PROPERTY_MODEL_FILE, uri);
properties.put(XmlModel.PROPERTY_XSD_FILE, xsdURI);
properties.put(XmlModel.PROPERTY_READONLOAD, readOnLoad + "");
properties.put(XmlModel.PROPERTY_STOREONDISPOSAL,
storeOnDisposal + "");
xmlModel.load(properties);
return xmlModel;
}
示例14: getModels
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
public IModel[] getModels(String inputPath, String outputPath)
throws EolModelLoadingException, URISyntaxException, FileNotFoundException {
// EGL transformation does not have output model, only generated output
return new IModel[] { createEmfModel(Role.SOURCE, inputPath) };
}
示例15: getModels
import org.eclipse.epsilon.eol.exceptions.models.EolModelLoadingException; //导入依赖的package包/类
@Override
public IModel[] getModels(String inputPath, String outputPath)
throws EolModelLoadingException, URISyntaxException, FileNotFoundException {
// EOL transformation only alters the input model, does not create output model
return new IModel[] {createEmfModel(Role.BOTH, new File(inputPath).toURI().getPath() ) };
}