How to create an EString to set as EType for an EAttribute [message #423975] |
Sun, 12 October 2008 18:46 |
Eclipse User |
|
|
|
Originally posted by: mam05eux.studserv.uni-leipzig.de
Hello,
I´ve searched for a long time now and I didn´t find a way to get an
instance of EString to set it as the EType for a new created EAttribute.
Here is a snippet of my code:
EAttribute nameAttribute = fac.createEAttribute();
nameAttribute.setName("name");
nameAttribute.setLowerBound(1);
nameAttribute.setUnique(false);
//here I want to set the EType of the nameAttribute (with method
nameAttribute.setEType(.?.))
c.getEStructuralFeatures().add(nameAttribute);
//c is my EClass!
So, how can I get an instance of EString to set it there?
Thanks.
|
|
|
|
Re: How to create an EString to set as EType for an EAttribute [message #423980 is a reply to message #423979] |
Mon, 13 October 2008 08:07 |
Eclipse User |
|
|
|
Originally posted by: mam05eux.studserv.uni-leipzig.de
Ok,
thanks a lot!
I just didn´t find it.
Stanley
Hallvard Trætteberg schrieb:
> Stanley,
>
> EcorePackage.eINSTANCE.getEString() gives you the EString EDataType
> instance.
>
> Hallvard
>
> Stanley Hillner wrote:
>
>> EAttribute nameAttribute = fac.createEAttribute();
>> nameAttribute.setName("name");
>> nameAttribute.setLowerBound(1);
>> nameAttribute.setUnique(false);
>>
>> //here I want to set the EType of the nameAttribute (with method
>> nameAttribute.setEType(.?.))
>> c.getEStructuralFeatures().add(nameAttribute);
>> //c is my EClass!
>> So, how can I get an instance of EString to set it there?
>> Thanks.
|
|
|
Re: How to create an EString to set as EType for an EAttribute [message #423987 is a reply to message #423980] |
Mon, 13 October 2008 15:27 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Stanley,
EcorePackage.Literals.ESTRING is a nice way too. It's a bit more efficient.
Stanley Hillner wrote:
> Ok,
>
> thanks a lot!
> I just didn´t find it.
>
> Stanley
>
> Hallvard Trætteberg schrieb:
>> Stanley,
>>
>> EcorePackage.eINSTANCE.getEString() gives you the EString EDataType
>> instance.
>>
>> Hallvard
>>
>> Stanley Hillner wrote:
>>
>>> EAttribute nameAttribute = fac.createEAttribute();
>>> nameAttribute.setName("name");
>>> nameAttribute.setLowerBound(1);
>>> nameAttribute.setUnique(false);
>>>
>>> //here I want to set the EType of the nameAttribute (with method
>>> nameAttribute.setEType(.?.))
>>> c.getEStructuralFeatures().add(nameAttribute);
>>> //c is my EClass!
>>> So, how can I get an instance of EString to set it there?
>>> Thanks.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03161 seconds