Example 2: Adding a Generation Option

In this example, we will add a generation option to the Java object language.

  1. Select Language > Edit Current Object Language to open the Java resource file.
  2. Expand the Generation category, and then right-click the Options category and select New in the contextual menu to create a new option:


  3. Click OK to save your changes and return to the model. Then select Language > Generate Java code to open the Generation dialog, and click the Options tab. The new option is listed on the tab under its comment (or its name, if no comment has been provided):


Note: For detailed information about creating and modifying generation templates, see Customizing Generation with GTL. It is strongly advised that you first read this chapter in order to get familiar with the concepts and features of the generation process.