nUML is a command-line tool written in Go that parses draw.io XML files and generates corresponding Java class files. It acts as a bridge between visual design and implementation by converting your class diagrams into boilerplate Java code.
nUML là công cụ dòng lệnh được viết bằng Go, phân tích cú pháp tệp XML draw.io và tạo các tệp Java tương ứng. Nó hoạt động như một cầu nối giữa thiết kế trực quan và triển khai bằng cách chuyển đổi sơ đồ lớp của bạn thành mã Java.
Thai Thanh Nguyen
- XML Parsing: Reads
draw.ioXML exports to understand your class structure. - Java Generation: Automatically creates
.javafiles for classes defined in the diagram. - Package Management: Supports generating files into specific packages/folders.
- Reporting: Generates a
Report.mdsummarizing the classes created. - Customizable: Options to overwrite files, suppress reports, and control verbosity.
- Dịch XML: Đọc file XML từ draw.io và chuyển đổi sang Java class.
- Tạo package: Tạo package và folder tương ứng với package.
- Tạo báo cáo: Tạo báo cáo tóm tắt các class đã tạo.
- Tùy chỉnh: Tùy chỉnh ghi đè file, tắt báo cáo và kiểm soát verbosity.
- Download nUML.exe from the Releases page.
- Run the following command:
./nUML [options] <file.drawio>./nUML -f folderName -o my_diagram.drawio- Go: Version 1.25.3 or higher.
- Clone the repository (or download the source code).
- Navigate directly to the project folder.
You can run the tool directly using go run:
go run . [options] <file.drawio>A convenience script nUML.bat is provided:
nUML.bat [options] <file.drawio>Basic usage:
go run . my_diagram.drawioGenerate into a package "com.example.models" (folder "models") and overwrite existing files:
go run . -f models -o my_diagram.drawiogo build -o nUML.exe main.go| Option | Description |
|---|---|
-f <folder> |
Generate files in the specified folder and add package declaration. |
-o |
Overwrite existing files (default: false). |
-v |
Verbose mode (print detailed progress). |
-l |
Skip generation of Report.md. |
-h |
Show help message. |
| Lựa chọn | Mô tả |
|---|---|
-f <folder> |
Tạo file trong thư mục được chỉ định và thêm khai báo package. |
-o |
Ghi đè file hiện có (mặc định: false). |
-v |
Chế độ verbose (in tiến trình chi tiết). |
-l |
Bỏ qua việc tạo Report.md. |
-h |
Hiển thị thông báo trợ giúp. |
