Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » newbie: how to generate multiple files from one model element
newbie: how to generate multiple files from one model element [message #1219015] Fri, 29 November 2013 16:17 Go to next message
Martin Trummer is currently offline Martin Trummer
Messages: 15
Registered: February 2011
Junior Member
say I have a model element named Entity and I want to generate 2 java classes out of it:

  • EntityBase.java which should be stored in /src-gen
  • Entity.java which should be stored in /src, if it does not exist yet (and extend EntityBase)


in the AbstractModelInferrer I can add e.g. 2 new classes via the the JvmTypesBuilder. But how do I define to which directories the files are saved to?

I hope someone can point me in the right direction: i.e.

  • the OutputConfigurationProvider looks quite promising, but how do I configure this? - via the mwe2 file?
  • must extend JvmModelGenerator and make my own generator?
  • is there maybe an example somewhere?
Re: newbie: how to generate multiple files from one model element [message #1219016 is a reply to message #1219015] Fri, 29 November 2013 16:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6388
Registered: July 2009
Senior Member
Afaik you have still to subclass jvmmodelgenerator
http://www.eclipse.org/forums/index.php/t/389208/

--
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: newbie: how to generate multiple files from one model element [message #1219219 is a reply to message #1219016] Mon, 02 December 2013 16:43 Go to previous message
Martin Trummer is currently offline Martin Trummer
Messages: 15
Registered: February 2011
Junior Member
great example - thanks.
Previous Topic:Can't manage to set breakpoints
Next Topic:EMF + Xtext 2.4.3: Error in serialization of EObject
Goto Forum:
  


Current Time: Fri Oct 24 13:40:23 GMT 2014

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

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