Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to obtain the literal from a GenFeature?
How to obtain the literal from a GenFeature? [message #910899] Mon, 10 September 2012 15:28 Go to next message
Eclipse UserFriend
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
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/
Previous Topic:shared EMF editor with CDO/hibernate
Next Topic:DoubleClick with key pressing
Goto Forum:
  


Current Time: Thu Apr 25 12:27:06 GMT 2024

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

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

Back to the top