Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsCreating instance of domain EClass
https://www.eclipse.org/forums/index.php/mv/msg/421054/964610/#msg_964610
If I make a domain class:
EClass d = EcoreFactory.eINSTANCE.createEClass();
d.setName( "D" );
Is it possible to create an instance of this class programmatically, e.g.:
EObject dO = ... d ...
Help is appreciated!]]>Peter Johnsen2012-10-30T17:02:44-00:00Re: Creating instance of domain EClass
https://www.eclipse.org/forums/index.php/mv/msg/421054/964615/#msg_964615
EObject dO = EcoreUtil.create(d);
HTH,
Christian
On 2012-10-30 17:02:44 +0000, Peter Johnsen said:
> Hi again,
>
> If I make a domain class:
>
> EClass d = EcoreFactory.eINSTANCE.createEClass();
> d.setName( "D" );
>
> Is it possible to create an instance of this class programmatically, e.g.:
>
> EObject dO = ... d ...
>
> Help is appreciated!]]>Christian Damus2012-10-30T17:06:30-00:00Re: Creating instance of domain EClass
https://www.eclipse.org/forums/index.php/mv/msg/421054/964622/#msg_964622
factory is reachable.
On 2012-10-30 17:06:30 +0000, Christian W. Damus said:
> Hi, Peter,
>
> EObject dO = EcoreUtil.create(d);
>
> HTH,
>
> Christian
>
>
> On 2012-10-30 17:02:44 +0000, Peter Johnsen said:
>
>> Hi again,
>>
>> If I make a domain class:
>>
>> EClass d = EcoreFactory.eINSTANCE.createEClass();
>> d.setName( "D" );
>>
>> Is it possible to create an instance of this class programmatically, e.g.:
>>
>> EObject dO = ... d ...
>>
>> Help is appreciated!]]>Christian Damus2012-10-30T17:07:25-00:00Re: Creating instance of domain EClass
https://www.eclipse.org/forums/index.php/mv/msg/421054/966781/#msg_966781
I actually tried using EcoreUtil.create(...) before posting on this forum, but I hadn't added the class to a package, and thus, it didn't work. Your second post addressed that.
Great, take care!]]>Peter Johnsen2012-11-01T08:19:15-00:00