API for writing Java transformations
We present in these pages how to write transformations with the fluent API, available since Optimus 1.2, in the plugin net.atos.optimus.m2m.javaxmi.operation. This API propose a high level abstraction of the Java Abstract Syntax Tree used by modisco. So, the API enables to manipulate concept of the Java language by encapsulate AST object, accessible by the getDelegate() method.
The javadoc of the API is available here
We describe how to generate the different elements of the Java language with sample code and we show the associated code produced.
There may have three ways to write transformations :
Use static method in helper for a full customization of the generated Java element.
Build the concept with helper and take profit of some default behaviors.
Customize directly the created Java element.
We can generate the following elements of the Java language :
Below, the class diagram of the API elements :