Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » load ecore file into dynamic EMF
load ecore file into dynamic EMF [message #431662] Tue, 21 July 2009 09:48 Go to next message
Christian Saad is currently offline Christian SaadFriend
Messages: 39
Registered: July 2009
Member
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
Re: load ecore file into dynamic EMF [message #431666 is a reply to message #431662] Tue, 21 July 2009 11:57 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
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">


Re: load ecore file into dynamic EMF [message #431725 is a reply to message #431666] Thu, 23 July 2009 08:00 Go to previous message
Christian Saad is currently offline Christian SaadFriend
Messages: 39
Registered: July 2009
Member
Thanks, I guess it was too obvious to notice ;)
Previous Topic:Classloader problem due to Teneo caching mechanism.
Next Topic:[CDO] Streaming of binary data
Goto Forum:
  


Current Time: Fri Apr 26 21:59:30 GMT 2024

Powered by FUDForum. Page generated in 0.03481 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top