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: 51
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: 28766
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.
Previous Topic:can-not open xmI files
Next Topic:[EMF Forms] Ecore and Genmodel editor issues
Goto Forum:
  


Current Time: Sun Sep 24 19:39:12 GMT 2017

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

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