Imagine you want to implement different behavior for a code generation template depending on certain conditions.
One way to do that would be to use if blocks to distinguish between those cases.
Another, more elegant, way is to use pre-conditions. Let's say that you want to generate different code for associations whether or not they are declared ordered.
The above example shows the ? (condition) syntax that tells Acceleo that the template must only be run if the pre-condition is satisfied.
No comments:
Post a Comment