No project description provided
Project description
GenUML - Generate PlantUML from Java class files
This tool aids in creating PlantUML class diagrams by generating UML diagrams from Java class files. Diagrams can be generated from single class files, or generated diagrams can be inserted into PlantUML code based on comments containing the correct "pattern".
$ genuml --help
Usage: genuml [OPTIONS] COMMAND [ARGS]...
Generate PlantUML class diagram DSL from Java class files.
Options:
--version
--help Show this message and exit.
Commands:
generate Generate PlantUML for single given Java class file.
insert Insert diagrams into PlantUML containing pattern comments.
Some functionality, as well as the generated diagram style, are based on ObjectAid UML Explorer, an Eclipse plug-in which seems to no longer be supported.
Example usage
genuml insert --class-dir "WEB-INF/classes" plantuml-diagram.txt | java -jar plantuml.jar -pipe > diagram.png
Some explanation:
- Compiled classes are found in
WEB-INF/classes
. plantuml-diagram.txt
contains PlantUML code as well as "pattern" comments referencing specific classes contained in the given folders (see example).- This file will be processed with the generated diagrams being placed directly after their pattern comments. Transformed output will be printed to stdout (and in this example, piped directly to PlantUML).
plantuml.jar
has been downloaded to the local folder.
Example PlantUML with pattern comments
@startuml
skinparam linetype polyline
' Pattern comments that will be processed by GenUML:
'[JAVA] tests.data.ExampleClass
'[JAVA] tests.data.ExampleAbstract
'[JAVA] tests.data.ExampleInterface
'[JAVA] tests.data.ExampleEnum: LOW HIGH
ExampleInterface *-- ExampleClass : implements
ExampleClass .> "0..1" ExampleEnum
ExampleClass -> ExampleAbstract
@enduml
which could then be used to generate this diagram:
Installation
Install from PyPI
With Python 3
installed on your system, you can run:
pip install genuml
To test that installation worked, run:
genuml --help
and you can uninstall at any time with:
pip uninstall genuml
Install from Github
To install the newest code directly from Github:
pip install git+https://github.com/samuller/genuml
And uninstall remains the same:
pip uninstall genuml
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.