| [MMT] EMFInjector to inject objects [message #986899] |
Thu, 22 November 2012 05:18  |
Hassan BAZOUN Messages: 48 Registered: April 2012 |
Member |
|
|
Hello,
i want to use the EMFInjector (or an extension of this class) in order to inject an object into an IModel is this possible?
i don't want to use an xmi file but the object directly !!! i found some limits since am using CDO Objects and thus the resource's content of such objects is a list of all available cdo objects and not the desired object.
in brief i want to do the following:
source metamodel is a .ecore file (OK)
target metamodel is a .ecore file (OK)
source model is an object containing other children object (possible??)
taregt model is an xmi file (OK)
i don't want to use xmi file for the input model ?
any ideas and suggestions are welcomed.
thanks in advance.
HB
[Updated on: Thu, 22 November 2012 05:18] Report message to a moderator
|
|
|
| Re: [MMT] EMFInjector to inject objects [message #986904 is a reply to message #986899] |
Thu, 22 November 2012 05:39   |
Hugo Bruneliere Messages: 467 Registered: July 2009 |
Senior Member |
|
|
Hello,
You can load any EMF metamodel/model registered in the EMF Registry by using its URI.
Instead of passing a path for the injection, you can use a string such as "URI:MyModelURI" (cf. the Javadoc of the EMFInjector.inject methods).
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
| Re: [MMT] EMFInjector to inject objects [message #986995 is a reply to message #986951] |
Thu, 22 November 2012 12:46   |
Hugo Bruneliere Messages: 467 Registered: July 2009 |
Senior Member |
|
|
In EMF a model is a Resource (or several ones).
As I told you in my previous post, in ATL you are not forced to load a model from a file and you can also do it from the memory using the EMF model (Resource) URI.
Your root EObject should be contained in a Resource, so you can get its URI.
Anyway, for more EMF related questions, using the EMF forum would be preferable.
I hope this helps.
Hugo
------------------------------------------
Hugo Bruneliere - R&D Engineer
AtlanMod research team (Inria, EMN & LINA)
Ecole des Mines de Nantes
Nantes - France
------------------------------------------
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01892 seconds