How to generate XMI files for Java source code?

I am writing a program in Java language, which takes java source code as input and outputs XMI file, which contains the class diagram of source code

I have studied XMI structure, but I can't find enough resources to explain the structure and order of tags

The first question is how can I find out the order of tags and the definition of each tag? For example, what does "isactive = false" mean?

Second, are there any suggestions about libraries or any Java language that can help me complete this project?

Solution

I don't think tag order matters in XMI Typically, XMI only defines how to map MOFs to XML So basically, you build the M2 model from Java (= UML), and then if I understand it correctly, map it to XML with XMI (I think double indirection is the reason why you can't find a good resource for mapping from UML to XMI)

For many people, examples may be more accessible than the chain of transformation rules defined by various OMG standards So I just want to draw a minimum UML sample diagram in my favorite UML tool for the export aspects I am interested in, and view the exported XMI Then add features as needed

P. S.: you may want to use the java reflection class (package Java. Lang. reflect) instead of parsing the Java source to generate XMI (if you don't need to keep the method parameter name)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>