Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Getting StructuralFeatures even from superclass?
Getting StructuralFeatures even from superclass? [message #717745] Mon, 22 August 2011 08:39 Go to next message
Daniel Trierweiler is currently offline Daniel TrierweilerFriend
Messages: 67
Registered: June 2011
Member
Hi guys,

currently I'm struggling with a problem created by the Xtext feature, that takes similar attributes to the superclass.

Lets say I have the types
GeneralConversion:
    LinearConversion | VerbalConversion


and both start with
name = ID
.

So far so good. But now I want to access all EStructuralFeatures with eObj.eClass().getEStructuralFeatures() (eObj being of type LinearConversion or VerbalConversion, GeneralConversion is used only as a reference in another part of the grammar).
Now I can't access the name attribute anymore, cause it resides in the GeneralConversion class.
Is there any way to get this attribute too, without changing the grammar?

Thanks a lot!

Best,
Daniel
Re: Getting StructuralFeatures even from superclass? [message #717748 is a reply to message #717745] Mon, 22 August 2011 08:44 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13887
Registered: July 2009
Senior Member
Hi,

what about asking the EClass for its ESuperTypes?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Getting StructuralFeatures even from superclass? [message #717757 is a reply to message #717748] Mon, 22 August 2011 09:05 Go to previous messageGo to next message
Daniel Trierweiler is currently offline Daniel TrierweilerFriend
Messages: 67
Registered: June 2011
Member
Thanks a lot Christian.
I used getESuperTypes without success, but getEAllSuperTypes does the trick Smile
(no subject) [message #717765 is a reply to message #717757] Mon, 22 August 2011 09:27 Go to previous message
Eclipse UserFriend
Originally posted by: Koen Yskout

getEAllStructuralFeatures is probably even easier for what you need :)

On 22/08/11 11:05, Daniel Trierweiler wrote:
> Thanks a lot Christian.
> I used getESuperTypes without success, but getEAllSuperTypes does the
> trick :)
Previous Topic:Xtend2 Codegen in running Eclipse instance
Next Topic:While ,Run As -> Generate Xtext Artifacts
Goto Forum:
  


Current Time: Wed Apr 21 01:48:33 GMT 2021

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

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

Back to the top