Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » modeling attribute as enum in ecore
modeling attribute as enum in ecore [message #1765109] Tue, 06 June 2017 18:13 Go to next message
Geoffry Roberts is currently offline Geoffry RobertsFriend
Messages: 52
Registered: July 2016
Member
This has got to be simple but it is getting past me.

I have modeled enums before when generating from xsd. Now I need use ecore and I am not getting what should be easy.

Here's what I want the generated code to look like. How do I model this in ecore?

JavaClass {

   enum XYZ {X, Y, Z};

   private XYZ xyz;

}


Thanks
Re: modeling attribute as enum in ecore [message #1765144 is a reply to message #1765109] Wed, 07 June 2017 03:31 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
EMF will never generate an enum nested in some other class. You create an EEnum just like you do an EClass or an EDataType directly as a child of the EPackage. Then you can create EENumLiterals as children of the EEnum.

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:can-not open xmI files
Next Topic:[EMF Forms] Ecore and Genmodel editor issues
Goto Forum:
  


Current Time: Thu Apr 25 20:02:33 GMT 2024

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

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

Back to the top