This shows you the differences between two versions of the page.

Link to this comparison view

tutorial:generator [2020/04/16 10:56] (current)
Line 1: Line 1:
 +<wrap adititle>​Generators aims to build final Java classes:</​wrap>​
 +<columns 100% l 100px>
 +{{tutorial:​generator.png?​500 |Generator}}
 +<​newcolumn lt>
 +A **generator** transforms an **XML** file (see [[tutorial:​scenario|scenario]]) in **java** classes.
 +For example, the generator <wrap adicode>​org.adichatz.generator.PartTreeGenerator</​wrap>​ class  can take a **ActorEDITORGENERATED.axml** file as input to generate 3 java classes:
 +  - '<​wrap adicode>​org.mycompany.myproject.ui.gencode.model.actor.ActorEDITOR</​wrap>'​.\\
 +  - '<​wrap adicode>​org.mycompany.myproject.ui.gencode.model.actor.ActorEDITORPage1</​wrap>'​.\\
 +  - '<​wrap adicode>​org.mycompany.myproject.ui.gencode.model.actor.ActorEDITORDependencies</​wrap>'​.\\
 +In the same vein, <wrap adicode>​org.adichatz.generator.QueryGenerator</​wrap>​ class, takes the **FilmQUERY** java class as input to build the '<​wrap adicode>​org.mycompany.myproject.model.gencode.model.film.FilmQUERY</​wrap>'​ file.
 +\\ \\
 +<WRAP indic>​You can  create your own generator classes or select generator classes.</​WRAP>​
 +<columns 100% l>
 +You can  create your own **generator** classes and decide to use them in generation process.:
 +<columns 100% l>
 +  * Create you generator class, e.g. by extending an existing generator.
 +  * Open the '<​wrap adicode>​./​resources/​xml/​Scenario.xml</​wrap>'​ file with Scenario Editor.
 +  * Select <wrap adicode>​Features</​wrap>​ page.
 +  * Select <wrap adicode>​Generators</​wrap>​ tab.
 +  * In the Outline part, focus on '<​wrap adicode>​treeClassName</​wrap>'​ field 'and select available generators (CTL-Space).\\
 +<​newcolumn lt>
 +{{tutorial:​select_generator.png?​550 |Select generator}}