|
VP-UML facilitate the generation and reverse of Java by the Java Round-Trip Engineering.
![]() |
|
Figure 11.1? - Generate code
|
![]() |
| Figure 11.2 - Class diagram used as an example |
|
| Figure 11.3 - Select Generate Code... |
![]() |
| Figure 11.4 - Configure the Source Folder |
![]() |
| Figure 11.5 - Configure the Advanced Options |
![]() |
| Figure 11.6 - Select OK |
![]() |
| Figure 11.7 - Java files generated |
![]() |
| Figure 11.8 - Reverse code |
![]() |
| Figure 11.9 - Java source of Professor.java |
![]() |
| Figure 11.10 - Select Reverse Code... |
![]() |
| Figure 11.11 - Configure Source Folder |
![]() |
| Figure 11.12 - Select OK to confirm |
![]() |
| Figure 11.13 - Class Repository pane |
![]() |
| Figure 11.14 - Drag and drop to create a new class |
![]() |
| Figure 11.15 - Java round-trip Engineering |
![]() |
| Figure 11.16 - Statement amended |
![]() |
| Figure 11.17 - Class added |
![]() |
| Figure 11.18 - Signature amended |
![]() |
| Figure 11.19 - Generate Java code |
![]() |
|
Figure 11.20 - Source changed
|
![]() |
|
Figure 11.21 - Class changed
|
![]() |
| Figure 11.22 - Code tab |
| Name | Description |
|---|---|
| Default attribute prefix | Configure the default prefix of attribute. |
| Default operation return type |
Configure the default return type of operation. |
| Default parameter type |
Configure the default prefix of parameter. |
| Remove method body after changes to abstract method |
Check the check box to remove method body after change to abstract method. |
| Add import statement instead of using fully qualified type name |
Check the check box to add import statement. |
| Import fully qualified type name for referenced type | Check the check box to import fully qualified type name. |
| Auto realize interface |
Check the check box to realize interface automatically. |
| Collection type |
Select a collection type from the drop down menu. |
| Use generic collections | Check the check box to use generic collections. |
| Generate annotation on | Specify the code generator to generate the annotation in field-based or property-based access type. |
| Generate annotation in code convention | Checked the checkbox so that before updating the code, VP-UML will select suitable placement strategy on either field-based or property-based access type. |
| System default | Select the system default type of text file encoding to type. |
| Other | Select other types of text file encoding to type. |
![]() |
| Figure 11.23 - Example illustrating options in Code tab about default type setting |
![]() |
| Figure 11.24 - Example illustrating options in Code tab about Remove method body |
![]() |
| Figure 11.25 - Example illustrating options in Code tab about Add import statement |
![]() |
| Figure 11.26 - Example illustrating options in Code tab about Auto realize interface |
![]() |
| Figure 11.27 - Example illustrating options in Code tab about Java Collection |
![]() |
| Figure 11.28 - Brace and Indentation tab |
| Name | Description |
|---|---|
| Class declaration |
Select the position of Class declaration from the drop-down menu. You can place it on the same line or the next line. |
| Constructor declaration |
Select the position of Constructor declaration drop-down menu. You can place it on the same line or the next line. |
| Method declaration |
Select the position of Method declaration drop-down menu. You can place it on the same line or the next line. |
| Enum declaration |
Select the position of Enum declaration drop-down menu. You can place it on the same line or the next line. |
| Annotation type declaration |
Select the position of Annotation type declaration drop-down menu. You can place it on the same line or the next line. |
| All Same Line |
Select to set all the brace positions to be on the same line. |
| All Next Line |
Select to set all the brace positions to be on the same line. |
| Indentation policy |
Select a way of indentation. You may choose Tabs and space to be the indentation. |
| Indentation size |
If you select space as indentation, you can select the size of it. |
![]() |
| Figure 11.29 - Example illustrating options in Brace and Indentation tab |
![]() |
| Figure 11.30 - New Lines Tab |
| Name | Description |
|---|---|
| Before package declaration |
Type in the number of blank lines place before package declaration. |
| After package declaration |
Type in the number of blank lines place after package declaration. |
| Before import declaration |
Type in the number of blank lines place before import declaration. |
| After import declaration |
Type in the number of blank lines place after import declaration. |
| Before first declaration |
Type in the number of blank lines place before first declaration. |
| Before different kind declaration |
Type in the number of blank lines place before different kind declaration. |
| Before field declaration |
Type in the number of blank lines place before field declaration. |
| Before method declaration |
Type in the number of blank lines place before method declaration. |
| Before inner type declaration |
Type in the number of blank lines place before inner type declaration. |
| Number of lines to empty body | Type in the number of blank lines place to the empty body. |
![]() |
| Figure 11.31 - Example illustrating options in New Lines tab |
![]() |
| Figure 11.32 - Example illustrating option in New Lines tab |
|
|
|||||||