Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [acceleo] how to call a template method from inside a java method
[acceleo] how to call a template method from inside a java method [message #727267] Tue, 20 September 2011 18:45 Go to next message
Leonardo Kenji Shikida is currently offline Leonardo Kenji Shikida
Messages: 37
Registered: July 2009
Member
Hi

is there any way to call a template method from inside a java method (for example, a java method exposed by an acceleo service)?

TIA

Kenji
Re: [acceleo] how to call a template method from inside a java method [message #727424 is a reply to message #727267] Wed, 21 September 2011 09:21 Go to previous message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 406
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

First of all, you may want to reconsider how you want to handle your problem if you "have" to call an Acceleo template in a Java service but the Acceleo APIs allow you to call a template directly if you want. You should have a look at org.eclipse.acceleo.engine.generation.AcceleoEngine#evaluate(...), you may also need to have a look at the superclass of your Java launcher (AbstractAcceleoGenerator) to see in the initialize method how we are loading the Acceleo generator. Once loaded, you can navigate inside to find your template and call it with the engine.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo



Previous Topic:[Acceleo] Codebeautifier and conditional codegeneration
Next Topic:Emfatic text from Ecore
Goto Forum:
  


Current Time: Wed Sep 24 04:47:04 GMT 2014

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

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