|
Re: Creating instance if only the EObject class is known [message #1148106 is a reply to message #1147903] |
Mon, 21 October 2013 09:06 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
Jens,
There isn't a general way (utility provided by EMF) of working back from
a just a java.lang.Class instance for some generated interface to the
Ecore model for that thing. If you provide a bit more context of how
this problem arises I might be able to suggest strategies that make
sense. Generally you'll need to search the classifiers of EPackages for
ones with an instanceClass that matches and of course you could iterate
over all packages in the package registry, but that's considered bad
behavior in the IDE because if force starts all those bundles...
On 21/10/2013 7:57 AM, Jens Rabe wrote:
> I am in a situation where I only know the fully-qualified class name
> of the interface of my EObject, like com.example.MyObject, and its
> contributing bundle. Now I need to create an instance of this object.
>
> Is there a clean approach, preferably a true EMF way of doing this?
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03439 seconds