• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java EmfModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DatabaseFunction类代码示例发布时间:2022-05-23
下一篇:
Java StaticListableBeanFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap