Java 소스 코드에 대한 XMI 파일을 생성하는 방법은 무엇입니까? (How to generate XMI file for the java source code?)


문제 설명

Java 소스 코드에 대한 XMI 파일을 생성하는 방법은 무엇입니까? (How to generate XMI file for the java source code?)

I'm writing a program in java language which takes the java source code as an input and the output is xmi file which contains the class diagram of the source code.

I have researched for xmi structure but I was not able to find an adequate resource which explain the structure and order of tags.

First question is how can I found out what is the order of the tags and definition of each tag? for instance, what is the meaning of "isActive = false" etc?  

Secondly, is there any suggestion of libraries or anything in java language which can help me to finish this project?


참조 솔루션

방법 1:

I think the tag order doesn't matter in XMI. In general, XMI just defines how to map MOF to XML. So basically you build the M2 model (=UML) from Java and and then map this to XML with XMI if I understand this correctly (and I think the double indirection is why you don't find good resources for the mapping from UML to XMI directly). 

For many people, examples may be more accessible than the chain of transformation rules defined by the various OMG standards. So I'd just draw a minimal UML example diagram in my favorite UML tool for the export aspect I am interested in and look at the exported XMI. Then add features as needed...

P.S.: You may want to use the Java reflection classes (package java.lang.reflect) instead of parsing the the Java source yourself to generate XMI (if you don't need to preserve method argument names).

(by BernardStefan Haustein)

참조 문서

  1. How to generate XMI file for the java source code? (CC BY‑SA 3.0/4.0)

#xmi #java






관련 질문

Java 소스 코드에 대한 XMI 파일을 생성하는 방법은 무엇입니까? (How to generate XMI file for the java source code?)

UML/XMI 파일을 StarUML로 가져오는 방법은 무엇입니까? (How to import any UML/XMI files to StarUML?)

가져오기/내보내기 : XMI용 netbeans (Import/export : netbeans for XMI)

XMI 형식의 UML 다이어그램 (UML diagram in XMI Format)

연관이 아닌 UML 클래스 속성 목록에 대한 XPath 쿼리 (XPath query for list of UML class attributes that are not associations)

Eclipse UML2를 사용하여 Visual Paradigm 생성 XMI 파일 구문 분석 (Using Eclipse UML2 to parse a Visual Paradigm generated XMI file)







코멘트