UML to Code
UML to Code is a Visual Studio Code extension that generates source code from
PlantUML class diagrams (.puml).
The extension scans your UML files and automatically generates clean, structured
Java classes based on your diagrams.
🧠 How It Works (Important)
- You write your class diagrams in PlantUML (
.puml)
- All UML files must be placed inside a folder named
UML at the root of your workspace
- When your UML diagrams are complete, you run the command Scan UML
- The extension parses the diagrams and generates Java code next to the
.puml files
⚠️ The extension does not generate UML diagrams.
You must write valid PlantUML code yourself.
📁 Required Project Structure
Your workspace must contain a folder named UML:
✨ Features
- Parse PlantUML class diagrams (
.puml)
- Generate Java classes
- Support for:
- Classes
- Attributes
- Methods
- Constructors
- Visibility (
public, private, protected)
static attributes
- Automatic
final detection (constants in uppercase)
- Recursive scan of the
UML/ folder and subfolders
- Generated files are created next to their
.puml files
📂 Supported UML Syntax
Example PlantUML file:
@startuml
class Circle {
- posX : double
- posY : double
- radius : double
+ {static} RADIUS_DEFAULT : double
+ Circle()
+ calculateAir() : double
}
@enduml
| |