|Discovering a Java Project [message #1246589]
||Sat, 15 February 2014 07:25
| Jeremie Bresson
Registered: October 2011
Modisco seems to be a tool that I could use, but I am still in the phase of figuring out how it works. Sorry if this might be a Newbee question...|
I have a simple Java project (with one main class):
On the project node "simple java", I have opened the context menu: Discovery > Discoverers > Discover Java Project...
I let the parameter dialog I did not change anything
And I get an EMF-Editor with the analysis result.
From what I can tell, everything works well. I am not sure what I can get from the editor, but it definitively corresponds to my code.
I was expecting to be able to save the model corresponding to my Java code somewhere (some xmi file).
I would really appreciate some inputs...
* * *
I add a look at How to Discover Model and Generate Code programmatically.
After a lot of trials (and errors) I managed to execute the discover code snippet to generate the .xmi file programmatically. I did the classic game: start a second eclipse application (coming up with a second workspace, where I imported my "simple.java" project).
I am also not sure about the appropriate location for the proposed "modelDiscovery(String, String)" code snippet...
At the end, I could open the generated xmi file in the "Trace file viewer" Editor:
I am sure there is an easier way to get the xmi file corresponding to the java project...
Side question: is there another editor (for example with the Java Icons)?
* * *
Some other thoughts: I have some analysis to perform on an existing java project (finding and parsing several java classes to produce something else).
Instead of building directly on top of some tools (probably JDT or any other Java Parser), my idea is to use the model of the Java Project produced by MoDisco as interface. This way I decouple the "parse the java project" phase from my analysis.
I am hoping that reading (and reacting to) the MoDisco model is easier than involving a java Parser and navigating through the tree of files.
Maybe this assumption is wrong (do not hesitate to give your opinion on it).
* * *
Thank you a lot for all the ideas and pointers you can provide.
Powered by FUDForum
. Page generated in 0.02159 seconds