How to obtain the literal from a GenFeature? [message #910899] |
Mon, 10 September 2012 15:28 |
Eclipse User |
|
|
|
Hello,
is it possible to obtain the name of the literal being generated for
each GenFeature? Consider, e.g., a metaclass (EClass) called "Foo"
having a reference called "bars". Then the generated Package class will
contain an attribute in the nested Literals class called
FOO__BARS
The problem is that the method genFeature.getFeatureAccessorName()
returns this string:
FOO_BARS
Is there a possibility to obtain the first String instead of the second?
best regards,
Gilbert
|
|
|
Re: How to obtain the literal from a GenFeature? [message #910911 is a reply to message #910899] |
Mon, 10 September 2012 15:52 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
Gilbert,
A good way to answer this kind of question is to look at the templates.
More comments below.
On 10/09/2012 5:28 PM, Gilbert Mirenque wrote:
> Hello,
> is it possible to obtain the name of the literal being generated for
> each GenFeature? Consider, e.g., a metaclass (EClass) called "Foo"
> having a reference called "bars". Then the generated Package class will
> contain an attribute in the nested Literals class called
>
> FOO__BARS
>
> The problem is that the method genFeature.getFeatureAccessorName()
> returns this string:
>
> FOO_BARS
>
> Is there a possibility to obtain the first String instead of the second?
This is computed by the GenClass via getFeatureID(GenFeature). Note that
because of multiple inheritance, a derived class may declare feature IDs
for features from the base class; that's why it's not just a method on
GenFeature itself.
>
> best regards,
> Gilbert
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03512 seconds