Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Gendoc » Displaying all attributes of a class(Inherited and not)
Displaying all attributes of a class [message #1710160] Mon, 05 October 2015 07:09 Go to next message
Marc FLAUW is currently offline Marc FLAUWFriend
Messages: 151
Registered: July 2009
Senior Member

I am using a for loop to display all the attributes of a class in a table:
[for (p:uml::Property|element.eContents()->filter(uml::Property))]<drop/>

I have replaced the table by [] for sake of simplicity in the example above.

However this class inherits from a parent and I would like to have also the inherited attributes for this class.

How can I test if this class has a parent? and how can I show the attributes of the parent class in the same table?

Thanks and regards,

Re: Displaying all attributes of a class [message #1710163 is a reply to message #1710160] Mon, 05 October 2015 07:17 Go to previous message
Tristan Faure is currently offline Tristan FaureFriend
Messages: 460
Registered: July 2009
Senior Member
Hello the best is to use already defined uml operation
[for (p:uml::Property| if element.oclIsKindOf(uml::Classifier) then element.oclAsType(uml::Classifier).getAllAttributes() else  element.eContents()->filter(uml::Property) endif)]<drop/>

[Updated on: Mon, 05 October 2015 08:36]

Report message to a moderator

Previous Topic:Calling fragment inside a fragment
Next Topic:Checking for empty list of stereotypes
Goto Forum:

Current Time: Thu Feb 22 12:17:45 GMT 2024

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

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

Back to the top