Skip to content

Language Support

StarUML can generate source codes from UML models and build UML models from source codes (reverse engineering) for many programming languages. It can also generate DDL (Data Definition Language) from ER data models and build ER data models from DDL files.

Language Menu Source files for reverse engineering
Java Tools | Java… *.java
C++ Tools | C++… *.h, *.hh, *.hpp, *.hxx, *.h++, *.cpp, *.cc, *.cxx, *.c++, *.ipp, *.tpp
C# Tools | C#… *.cs
C Tools | C… *.h, *.c
Python Tools | Python… *.py, *.pyi
PHP Tools | PHP… *.php
TypeScript Tools | TypeScript… *.ts, *.tsx, *.mts, *.cts
JavaScript Tools | JavaScript… *.js, *.mjs, *.cjs, *.jsx
Rust Tools | Rust… *.rs
Go Tools | Go… *.go (except *_test.go)
Ruby Tools | Ruby… *.rb
Kotlin Tools | Kotlin… *.kt
Dart Tools | Dart… *.dart
Swift Tools | Swift… *.swift
DDL (MySQL, SQLite, PostgreSQL) Tools | DDL… *.sql, *.ddl

Each menu item opens a dialog having the Generate tab and the Reverse tab.

To generate source codes from a model:

  1. Select Tools | [Language]… in Menu Bar.
  2. Select the Generate tab.
  3. Select a Base Package. The codes of all elements in the package are generated. For DDL, select an ER data model.
  4. Enter the Output Folder or click Browse… to select a folder where generated codes to be located.
  5. Change the Options if needed.
  6. Click Generate button.

The generated files and the result are shown in Log. Existing files in the output folder are overwritten. Click Open Folder to open the output folder.

To build a model from source codes:

  1. Select Tools | [Language]… in Menu Bar.
  2. Select the Reverse tab.
  3. Select a Target Package where the analyzed elements to be contained. If (New model) is selected, a new model (e.g. JavaReverse) is created under the project.
  4. Enter the Source Folder or click Browse… to select a folder of the source files. All source files in the folder (including sub-folders) are analyzed, except hidden folders, node_modules and __pycache__.
  5. Change the Options if needed.
  6. Click Reverse button.

The analyzed files and the result are shown in Log, and the imported model is selected in Model Explorer. Even if a source file has syntax errors, the remaining parts of the file are analyzed, and the number of files with errors is shown in Log.

Depending on the options, diagrams are also created for the imported model: a type hierarchy diagram, a package structure diagram and overview diagrams of packages (for DDL, an ER diagram).

The options of each language (e.g. indentation, whether to generate documentation comments, whether to create associations for fields) are shown in Options of each tab. The options are also available in Preferences Dialog and are saved as preferences.

  • While generating or reversing, the button changes to Cancel. Click it to stop the job. Closing the dialog also stops the job.
  • Click Copy Log to copy the log to the clipboard, and Clear Log to clear the log.
  • The last used folders are remembered for each language.