xmi java model from *.java

View: New views
1 Messages — Rating Filter:   Alert me  

xmi java model from *.java

by Kelly Garces :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear all,

I am beginner in Netbeans. I want to use it to generate a xmi java model from *.java files. I found a message at the user mailing list relating to this ( http://mdr.netbeans.org/servlets/ReadMsg?listName=users&msgNo=3427). I got a question from it; is it mandatory develop a parsing tool?, I read Netbeans provides java parsing infraestructure.

However I don't know enough, I wrote a simple netbeans java project to manage my goal. The main class contains:

        File fakeFile = new File("Fake.java");
        FileObject fakeFO = FileUtil.createData(fakeFile);
        ClasspathInfo cpInfo = ClasspathInfo.create(fakeFO);
        JavaSource javaSource = JavaSource.create(cpInfo, fakeFO);
        XMIWriterFactory.getDefault().createXMIWriter().write(...)

But it is not successful, I got a lot of errors.

Please let me know what I did wrong, Is there any example to do this?

Thanks in advance.

PD: I use netbeans 6.