-->

Java code which creates UML diagrams

2019-09-16 12:08发布

问题:

I'm creating a program that will reverse engineer Java Source code into a UML class diagram. I have it reading all of the method names etc already from the source code but I'm wondering if there is any inbuilt Java methods for generating UML such as something like:

UMLdiagram u = new UMLdiagram();
Class c = new Class();
u.addClass(c);

Is there anything like this or are there any external tools I could use to help draw the UML diagram given that I already know methods, class attribute names etc.

回答1:

Take a look at http://en.wikipedia.org/wiki/List_of_Unified_Modeling_Language_tools.

Some of the tools listed are in Java, some of them are open source and some of them are able to create UML diagrams in the XMI format.

If you want something light-weight, then Doxygen together with Graphviz can both reverse-engineer Java source code and automatically generate class diagrams with UML_LOOK