Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Custom Code Overridden - Generator Model
Custom Code Overridden - Generator Model [message #1243193] Mon, 10 February 2014 11:53 Go to next message
Eclipse UserFriend
Hey,

I use a mwe script to generate code...e.g.:

 component = org.eclipse.emf.mwe2.ecore.EcoreGenerator
  {
    generateCustomClasses = false
    genModel = "platform:/.../gen.genmodel"
    srcPath = "platform:/.../src"
  }


However, this causes my custom added code (in the Java classes) to be overriden, even though I have @generated NOT or just add a Method in the class.

Any ide how this can be avoided? Thanks!
Re: Custom Code Overridden - Generator Model [message #1243206 is a reply to message #1243193] Mon, 10 February 2014 12:11 Go to previous messageGo to next message
Eclipse UserFriend
Create a class PersonImplCustom extends PersonImpl in the same
package and customize the code there
http://christiandietrich.wordpress.com/2013/07/26/use-of-ecoregenerator
-to-customize-emfs-generated-java-classes/

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: Custom Code Overridden - Generator Model [message #1243783 is a reply to message #1243206] Tue, 11 February 2014 07:38 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

I'm aware of this option, but I'm talking about code that are added in the "original" Java classes. This code is overriden, which is not desirable. Is there an option or something than can be used in the mwe-script?
Re: Custom Code Overridden - Generator Model [message #1243788 is a reply to message #1243783] Tue, 11 February 2014 07:49 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

you have to write your own/subclass EcoreGenerator
and reenable jmerge there
Re: Custom Code Overridden - Generator Model [message #1243848 is a reply to message #1243788] Tue, 11 February 2014 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Thanks,

why is this not enabled by default?
Re: Custom Code Overridden - Generator Model [message #1243849 is a reply to message #1243848] Tue, 11 February 2014 09:32 Go to previous message
Eclipse UserFriend
cause the component is made for generation gap and not protected regions
Previous Topic:different instances of editor were given
Next Topic:Generated ecore models refer to Xbase using relative paths
Goto Forum:
  


Current Time: Wed Jul 02 20:40:56 EDT 2025

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

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

Back to the top