Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [EMF] instantiate an instance of an object based on an EStructuralFeature
[EMF] instantiate an instance of an object based on an EStructuralFeature [message #1288294] Tue, 08 April 2014 08:26 Go to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi,

Does EMF have some facilities (Through i.e. a generated Switch or
AdapterFactory) to create an instance of of an EClass (Through a
Factory) based on it's EStructuralFeature?

Thanks, Christophe
Re: [EMF] instantiate an instance of an object based on an EStructuralFeature [message #1288490 is a reply to message #1288294] Tue, 08 April 2014 16:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
Christophe,

Comments below.



On 08/04/2014 10:26 AM, Christophe Bouhier wrote:
> Hi,
>
> Does EMF have some facilities (Through i.e. a generated Switch or
> AdapterFactory) to create an instance of of an EClass (Through a
> Factory) based on it's EStructuralFeature?
I'm not sure what you mean by "based on its EStructuralFEature". You can
off course call eStructuralFeature.getEContainingClass() and use
EcoreUtil.create of that EClass to create an instance. But of course
the feature's class could be abstract...
>
> Thanks, Christophe
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [EMF] instantiate an instance of an object based on an EStructuralFeature [message #1289358 is a reply to message #1288490] Wed, 09 April 2014 08:46 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 08-04-14 18:03, Ed Merks wrote:
> Christophe,
>
> Comments below.
>
>
>
> On 08/04/2014 10:26 AM, Christophe Bouhier wrote:
>> Hi,
>>
>> Does EMF have some facilities (Through i.e. a generated Switch or
>> AdapterFactory) to create an instance of of an EClass (Through a
>> Factory) based on it's EStructuralFeature?
> I'm not sure what you mean by "based on its EStructuralFEature". You can
> off course call eStructuralFeature.getEContainingClass() and use
> EcoreUtil.create of that EClass to create an instance. But of course
> the feature's class could be abstract...
Yes, this was my plan as well and then I figured some Util might already
do something similar. Thanks Ed, I will create something myself.
Cheers Christophe


>>
>> Thanks, Christophe
>>
>
Previous Topic:[EMF] Retrieving URI fragments
Next Topic:[CDO] NullPointerException at org.eclipse.emf.cdo.internal.server.Repository.ensureChunk
Goto Forum:
  


Current Time: Fri Apr 19 02:35:27 GMT 2024

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

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

Back to the top