Class Diagram Extractor & Coder for Java
J-Diagram is a Visual Studio Code extension to help Java developers. This provides a convenient conversion between the Java source code and the class diagram.
- Draw.io Integration
- Java SE >= 8
- Windows, MacOS, Linux
- Open command palette (
cmd
oralt
+shift
+p
). - Type
J-diagram : Convert Source to Diagram
to change Java sources into drawio diagram - Choose a way you would like to specify a path to Java sources.
- Specify where to find java sources
- The path may be a directory path for Java sources or a file path for just one Java file.
- Then, decide where you would like drawio file to be created. The file will have name of
j-diagram.drawio
- Open command palette (
cmd
oralt
+shift
+p
). - Type
J-diagram : Convert Diagram to Sources
to extract Java sources from drawio diagram - Choose a way you would like to specify a path to drawio file.
- Then, locate the drawio file.
- Decide where you would like Java files to be created.
- Make a runnable .jar file
- Import https://github.com/OH318/J-Diagram.git using the Eclipse.
- Right-click on the project.
- Select "Export" > "Java" >> "Runnable JAR file" and click Next button.
- Finish the process
- Execute .jar file
java -jar [runnable .jar path] [java src dir path] [.drawio file path] [0|1] # If the last argument is 0, extractor will be executed. # If the last argument is 1, coder will be executed.
- We had a classpath-related problem with one of the dependencies when we used Maven build in VSCode. So we chose to create the .jar file in Eclipse as an alternative. As soon as we find a solution, we will change it to using Maven build.
- Test cases using J-Unit are in converter/src/test/java/com/handong/oh318
- Test cases for integration testing are in converter/src/test/resource