本文整理汇总了Java中org.eclipse.epsilon.emc.emf.EmfModel类的典型用法代码示例。如果您正苦于以下问题:Java EmfModel类的具体用法?Java EmfModel怎么用?Java EmfModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EmfModel类属于org.eclipse.epsilon.emc.emf包,在下文中一共展示了EmfModel类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createEmfModel
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的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;
}
开发者ID:djhuistra,项目名称:UnifyingAttackTrees,代码行数:19,代码来源:EpsilonTransformer.java
示例2: createEmfModel
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的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;
}
开发者ID:adolfosbh,项目名称:cs2as,代码行数:17,代码来源:AbstractEolLauncher.java
示例3: createEmfModelByURI
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的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;
}
开发者ID:atlanmod,项目名称:emfviews,代码行数:25,代码来源:EclDelegate.java
示例4: loadProperties
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的package包/类
@Override
protected void loadProperties(){
super.loadProperties();
if (properties == null) return;
metamodels.clear();
// Restore values from legacy launch configuration
modelFileText.setText(properties.getProperty(EmfModel.PROPERTY_MODEL_FILE));
final String sLegacyFileMetamodels = properties.getProperty(EmfModel.PROPERTY_METAMODEL_FILE);
for (String sPath : sLegacyFileMetamodels.trim().split("\\s*,\\s*")) {
if (sPath.length() > 0) {
metamodels.add(sPath);
}
}
// Restore values that are used directly to construct an instance of EmfModel
final String sURIMetamodels = properties.getProperty(EmfModel.PROPERTY_METAMODEL_URI);
for (String sURI : sURIMetamodels.trim().split("\\s*,\\s*")) {
if (sURI.length() > 0) {
metamodels.add(URI.createURI(sURI));
}
}
expandButton.setSelection(new Boolean(properties.getProperty(EmfModel.PROPERTY_EXPAND)).booleanValue());
metamodelList.refresh();
}
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:28,代码来源:RemoteHawkModelConfigurationDialog.java
示例5: createEmfModelByURI
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的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;
}
开发者ID:adolfosbh,项目名称:cs2as,代码行数:15,代码来源:AbstractEolLauncher.java
示例6: start
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的package包/类
public static void start(String path)
{
try {
// Egl-Datei laden und Output setzen
EglFileGeneratingTemplateFactory eglTemplateFactory = new EglFileGeneratingTemplateFactory();
IEolExecutableModule module = new EglTemplateFactoryModuleAdapter(eglTemplateFactory);
System.out.println("Parsing template files...");
module.parse(new File(path+"Calender2HTML.egl").getAbsoluteFile());
// Fehler beim Parsen ausgeben
if (module.getParseProblems().size() > 0) {
System.err.println("Parse errors occured...");
for (ParseProblem problem : module.getParseProblems()) {
System.err.println(problem.toString());
}
}
// Metamodell hinzufügen
EmfModel model = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, "Mein Kalender");
properties.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI, path+"Calender.ecore");//"file:/" + new File(metamodel).getAbsolutePath());
properties.put(EmfModel.PROPERTY_MODEL_URI, "file:/" + new File(path+"mynew.calender").getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
properties.put(EmfModel.PROPERTY_READONLOAD, true + "");
properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, true + "");
model.load(properties, (IRelativePathResolver) null);
eglTemplateFactory.getContext().getModelRepository().addModel(model) ;
// Ausführen und in Datei schreiben
System.out.println( module.execute());
File file = new File(path+"calender.html");
FileOutputStream fop = new FileOutputStream(file);
if (!file.exists()) {
file.createNewFile();
}
byte[] contentInBytes = ((String) module.execute()).getBytes();
fop.write(contentInBytes);
fop.flush();
fop.close();
module.getContext().getModelRepository().dispose();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
开发者ID:Nielko,项目名称:MBSE-Vacation-Manager,代码行数:48,代码来源:StartEGL.java
示例7: storeProperties
import org.eclipse.epsilon.emc.emf.EmfModel; //导入依赖的package包/类
@Override
protected void storeProperties(){
super.storeProperties();
/*
* Compute comma-separated lists with the file paths and URIs. If we
* only have one metamodel (either file- or URI-based), it should be
* compatible with previous versions of Epsilon.
*/
final StringBuilder sbFileMetamodels = new StringBuilder();
final StringBuilder sbFileMetamodelURIs = new StringBuilder();
final StringBuilder sbURIMetamodels = new StringBuilder();
boolean bFirstFileMetamodel = true, bFirstURIMetamodel = true;
for (Object o : metamodels) {
if (o instanceof String) {
if (!bFirstFileMetamodel) {
sbFileMetamodelURIs.append(',');
sbFileMetamodels.append(',');
}
else {
bFirstFileMetamodel = false;
}
sbFileMetamodels.append((String)o);
sbFileMetamodelURIs.append(createFullyQualifiedUri((String)o));
}
else if (o instanceof URI) {
if (!bFirstURIMetamodel) {
sbURIMetamodels.append(',');
}
else {
bFirstURIMetamodel = false;
}
sbURIMetamodels.append(o.toString());
}
}
properties.put(EmfModel.PROPERTY_MODEL_FILE, modelFileText.getText());
properties.put(EmfModel.PROPERTY_METAMODEL_FILE, sbFileMetamodels.toString());
// Persist values that are used directly to construct an instance of EmfModel (legacy - only one metamodel was supported)
properties.put(EmfModel.PROPERTY_METAMODEL_URI, sbURIMetamodels.toString());
properties.put(EmfModel.PROPERTY_EXPAND, expandButton.getSelection() + "");
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "".equals(sbURIMetamodels.toString()));
// Create and persist URI values that are needed to construct an instance of EmfModel
properties.put(EmfModel.PROPERTY_MODEL_URI, createFullyQualifiedUri(modelFileText.getText()));
properties.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI, sbFileMetamodelURIs.toString());
properties.put(EmfModel.PROPERTY_REUSE_UNMODIFIED_FILE_BASED_METAMODELS, reuseUnmodifiedFileBasedMetamodelsButton.getSelection() + "");
}
开发者ID:mondo-project,项目名称:mondo-integration,代码行数:49,代码来源:RemoteHawkModelConfigurationDialog.java
注:本文中的org.eclipse.epsilon.emc.emf.EmfModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论