Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Code Generation Error for Meta Model Element named Enumeration
Code Generation Error for Meta Model Element named Enumeration [message #1213648] Wed, 27 November 2013 10:26 Go to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hello,

I have a meta-model element called Enumeration. When generating code I get an error in the factory class. The code generator does not know which class to use for the Enumeration (The Java one or the Meta-model one). Is there a way to define this in the Ecore or generator model?

Ralph
Re: Code Generation Error for Meta Model Element named Enumeration [message #1213795 is a reply to message #1213648] Wed, 27 November 2013 11:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30452
Registered: July 2009
Senior Member
Ralph,

I'm not sure why it should get confused about java.util.Enumeration
(after all, it cal deal with UML2's model that has Class, and Package).
Perhaps you can provide a simple example?

On 27/11/2013 11:26 AM, Ralph Gerbig wrote:
> Hello,
>
> I have a meta-model element called Enumeration. When generating code I
> get an error in the factory class. The code generator does not know
> which class to use for the Enumeration (The Java one or the Meta-model
> one). Is there a way to define this in the Ecore or generator model?
>
> Ralph
Re: Code Generation Error for Meta Model Element named Enumeration [message #1214075 is a reply to message #1213795] Wed, 27 November 2013 14:29 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1199
Registered: July 2009
Location: Canada
Senior Member

And UML also has a metaclass named "Enumeration"!

cW

On 2013-11-27 11:52:06 +0000, Ed Merks said:

> Ralph,
>
> I'm not sure why it should get confused about java.util.Enumeration
> (after all, it cal deal with UML2's model that has Class, and Package).
> Perhaps you can provide a simple example?
>
> On 27/11/2013 11:26 AM, Ralph Gerbig wrote:
>> Hello,
>>
>> I have a meta-model element called Enumeration. When generating code I
>> get an error in the factory class. The code generator does not know
>> which class to use for the Enumeration (The Java one or the Meta-model
>> one). Is there a way to define this in the Ecore or generator model?
>>
>> Ralph
Re: Code Generation Error for Meta Model Element named Enumeration [message #1214253 is a reply to message #1214075] Wed, 27 November 2013 16:07 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6458
Registered: July 2009
Senior Member
Hi

In my experience EMF codegen is pretty good about sorting out imports
even for difficulties like Class and Enumeration. This is becuase it
uses the already generated output as input to an updating merge. However
the downside is that if you have bad old content you get equivalently
bad new content.

Sometimes it is important to manually eliminate compilation errors from
your old code before regenerating it. If EMF gets it wrong, manually
correct it and it will probably then regenerate correctly.

Regards

Ed Willink



On 27/11/2013 14:29, Christian W. Damus wrote:
> And UML also has a metaclass named "Enumeration"!
>
> cW
>
> On 2013-11-27 11:52:06 +0000, Ed Merks said:
>
>> Ralph,
>>
>> I'm not sure why it should get confused about java.util.Enumeration
>> (after all, it cal deal with UML2's model that has Class, and
>> Package). Perhaps you can provide a simple example?
>>
>> On 27/11/2013 11:26 AM, Ralph Gerbig wrote:
>>> Hello,
>>>
>>> I have a meta-model element called Enumeration. When generating code
>>> I get an error in the factory class. The code generator does not
>>> know which class to use for the Enumeration (The Java one or the
>>> Meta-model one). Is there a way to define this in the Ecore or
>>> generator model?
>>>
>>> Ralph
>
>
Previous Topic:prune & graft on model.
Next Topic:EMF reference and referenced entities as elements in XML
Goto Forum:
  


Current Time: Fri Sep 20 10:02:29 GMT 2019

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

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

Back to the top