Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Get all EClasses of a model
Get all EClasses of a model [message #1152813] Thu, 24 October 2013 03:28 Go to next message
Thomas Wilhelm is currently offline Thomas Wilhelm
Messages: 28
Registered: September 2013
Junior Member
Hey all,

i have a propably easy question: How can i get all EClasses which are available in my model? I googeled and tried a lot, but acutally cant find a proper solution. Via my EPackage i can get all EClassifiers, but how to get from this classifiers to my EClasses? Or is there a complete other way?
Thanks for all hints and answers in advance,

have a good day,

Thomas

[Updated on: Thu, 24 October 2013 03:29]

Report message to a moderator

Re: Get all EClasses of a model [message #1152869 is a reply to message #1152813] Thu, 24 October 2013 04:17 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25750
Registered: July 2009
Senior Member
Thomas,

You test each EClassifier in ePackage.getEClassifiers() to see if it's
an instance of EClass.


On 24/10/2013 9:28 AM, Thomas Wilhelm wrote:
> Hey all,
>
> i have a propably easy question: How can i get all EClasses which are
> available in my model? I googeled and tried a lot, but acutally cant
> find a proper solution. Via my EPackage i can get all EClassifiers,
> but how to get my generated classes from this classifiers? Or is there
> a complete other way? Thanks for all hints and answers in advance,
>
> have a good day,
>
> Thomas
Re: Get all EClasses of a model [message #1152902 is a reply to message #1152869] Thu, 24 October 2013 04:43 Go to previous message
Thomas Wilhelm is currently offline Thomas Wilhelm
Messages: 28
Registered: September 2013
Junior Member
Hey Ed,

thanks for your reply. I did what you mentioned and it worked. Thanks for that. I thought there is maybe a more simple way to get this information, e.g. ECoreUtil.getAllClasses() or EPackage#getAllClasses(), respectively EPackage#getAllEnums.

Thanks a lot for your help,

Thomas
Previous Topic:IllegalArgumentException: feature not found in EClass
Next Topic:[TEXO] OrderBy for OneToMany
Goto Forum:
  


Current Time: Thu Apr 24 06:35:11 EDT 2014

Powered by FUDForum. Page generated in 0.04635 seconds