Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[acceleo] how to call a template method from inside a java method
https://www.eclipse.org/forums/index.php/mv/msg/241068/727267/#msg_727267
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]]>Leonardo Kenji Shikida2011-09-20T18:45:43-00:00Re: [acceleo] how to call a template method from inside a java method
https://www.eclipse.org/forums/index.php/mv/msg/241068/727424/#msg_727424
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.