I am writing an eclipse plugin which lets the user write java code using a drag and drop kind of UI. I have came across these two java source code generation libraries. Eclipse JDT AST and Code Model.
I would like to understand the pros and cons of the two libraries. According to what I have read and understood:
AST is very powerful. Looking at the code samples I have seen and the ASTView plugin, I am fully convinced that we can write any java construct using this library. Where as I could not find a lot of documentation or samples on Code Model. So, I am not very clear about its power. I would like to know if CodeModel is as powerful as AST.
The amount of code required for CodeModel is much less than AST to achieve the same functionality.
With AST, I can definitely re-write an existing java class. I couldn't find anything similar in case of CodeModel
I defenitely need the functionalities in 1 and 3. Having 2 also is an added advantage. I would like to know if codeModel has 1 and 3. Please let me know all the pros and cons of these two libraries. Also, let me know if there is a better library than these both.
Note: I am looking for souce code generation/manipulation and not byte code manipulation.
Thanks in advance.
I have used Eclipse JDT AST in my eclipse plugin for the following reason: