Java code generation functions

Generating several classes within a single source file

Java source files can contain several classes. To generate several classes in the same source file, the file’s main class is linked to the other files by an element import link stereotyped as JavaFileGroup.

A Java source file containing several classes is generated in the model in the following way:

The file’s main class is linked to the other files by an element import link stereotyped JavaFileGroup.

Java generation commands

Modelio Java Designer generation provides several features related to generation.

  • : The “Generate” command will generate Java code for the class.

  • : The “Edit” command will open an editor to modify the Java file content. When the editor is closed, the content of the file is automatically reversed.

  • : The “Update model” command will reverse the Java code for the class.

filegroup.png (23.6 KB) admin admin, 15 December 2014 10:22

generate.png (608 Bytes) admin admin, 15 December 2014 10:22

fig72_mod.gif (56.2 KB) admin admin, 15 December 2014 10:22

update.png (1.27 KB) admin admin, 15 December 2014 10:22

edit.png (484 Bytes) admin admin, 15 December 2014 10:22