|
Re: load ecore file into dynamic EMF [message #431666 is a reply to message #431662] |
Tue, 21 July 2009 11:57 |
|
This is a multi-part message in MIME format.
--------------010109010108090302060802
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
Chris,
The Ecore model is in many ways just like an ordinary model (i.e. an
Ecore-based DSL). In other words, an EPackage is an EObject.
You can load instances of the Ecore model with a normal ResourceSet:
| ResourceSet resourceSet = *new *ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put( "ecore", *new *EcoreResourceFactoryImpl());
Resource resource = resourceSet.getResource(URI.createFileURI(fileName), *true*);
EPackage model = (EPackage)resource.getContents().get(0);|
Cheers
/Eike
----
http://thegordian.blogspot.com
http://twitter.com/eikestepper
C. Saad schrieb:
> Hi everyone,
>
> is there a way to automatically create a dynamic emf meta-model for an
> existing .ecore file, i.e. I'm looking for a parser that reads the
> ecore file and creates the dynamic meta classes accordingly.
>
> Best Regards,
> Chris
>
--------------010109010108090302060802
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Chris,<br>
<br>
The Ecore model is in many ways just like an ordinary model (i.e. an
Ecore-based DSL). In other words, an EPackage is an EObject.<br>
<br>
You can load instances of the Ecore model with a normal ResourceSet:<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = --><!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3" cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td align="left" nowrap="nowrap"
valign="top"> <code><font color="#ffffff">
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
|
Powered by
FUDForum. Page generated in 0.03481 seconds