1
votes

I have to generate class diagrams from the java files such that the parser must be executable on the command line with the following format:

umlparser classpath output_file_name

umlparser is my .java file name

classpath is a folder name where all the .java source files will be

output file name is the name of the output image file you program will generate ( .jpg, .png or .pdf format)

Tools for parsing Java Source and generating UML diagrams can be used.

I was looking at http://yuml.me/diagram/class/draw and found that that is a good way to generate the class diagram.

However, I can't get the idea how can I get the code in the form of

[Customer|forname:string;surname:string|doPost();doGet()]<>-orders*>[Order]
[Order]++-0..*>[LineItem]
[Order]-[note:Aggregate root{bg:wheat}]

Any insight on how to generate this code?

Any other suggestions are also welcomed.

1
Why would you even want code in that form? Textual UML notation? - Geert Bellekens
Basically I want to generate the UML diagram from command line in the format of: umlparser classpath output_file_name. I dont want to generate it on IDE. However, I can use any API or library, but how to get result from command line. - codeblues
Are you looking for a UML tool able to reverse Java, generate diagram and having a remote API... I know some of them but I am not sure this is the right place. - Red Beard
@RedBeard could you pls let me know that API? - codeblues

1 Answers

1
votes

Maybe you need to take a look at doxygraph. Its maintainers define the tool as follows:

It relies on Doxygen to parse your source code and create an intermediate XML representation of the information it collects, so it supports all the same programming languages that Doxygen supports: C, C++, C#, Objective C, Java, Python, PHP, Tcl, D, IDL, VHDL, and Fortran.

Reverse-engineering functionality is also present in IntelliJ IDEA and Visual Paradigm editors, but it is a paid feature as far as I can remember.