Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to get enums per emf reflections?
How to get enums per emf reflections? [message #1831803] Sun, 30 August 2020 08:12 Go to next message
Dimg Cim is currently offline Dimg CimFriend
Messages: 59
Registered: December 2015
Hello all,

I am on imlementing a formular renderer based on a Emf class attributes. Currently the formular can find out all EAttributes and EReferences. My issue is eObject.eClass().getEAllAttributes() don't list me the enum attibutes. How can I access the enums?

EList<EAttribute> attributes = eObject.eClass().getEAllAttributes();
EList<EReference> eAllReferences = eObject.eClass().getEReferences();

for (EAttribute eAttribute : attributes) {
  // Render attributes

for (EReference eReference : eAllReferences) {
  // Render references

Are there something like eObject.eClass().getEEnums(); ?

Best regards

--> Please close this thread the EAllAttributes() displayed all attributes of a class. I misunderstood that. Thanks.

[Updated on: Sun, 30 August 2020 08:22]

Report message to a moderator

Re: How to get enums per emf reflections? [message #1831804 is a reply to message #1831803] Sun, 30 August 2020 08:49 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 32563
Registered: July 2009
Senior Member
Yes eObject.eClass().getEAllAttributes() returns all EAttributes including those whose getEAttributeType() is an instanceof EEnum from which you can call getELiterals() to get all the literals.

Ed Merks
Professional Support:
Previous Topic:Load an ecore file programmatically
Next Topic:Textual to graphical or vice versa tools
Goto Forum:

Current Time: Thu Dec 01 21:43:53 GMT 2022

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

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

Back to the top