Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Add annotation to a method in Eclipse
Add annotation to a method in Eclipse [message #691663] Sat, 02 July 2011 01:01
yongjiezheng is currently offline yongjiezhengFriend
Messages: 10
Registered: March 2011
Location: California
Junior Member
I know this should not be too hard, but I just cannot find the appropriate API to use. Any help would be appreciated.

What I am trying to do is to load a java interface file into a list of IMethod. This is easily done. For some specific IMethod, I want to add an annotation message and save the message back to the java interface file. Does anyone know how to do this?

//Code to load IMethod
IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
IJavaProject jProj = JavaCore.create(proj);
IType t = jProj.findType(className);
IMethod[] methods = t.getMethods();

Thanks a lot,
William
Previous Topic:Text-to-Model transformation
Next Topic:[Acceleo 3.1.0] Module file (.mtl) is not built into a .java file
Goto Forum:
  


Current Time: Sat Dec 16 07:18:03 GMT 2017

Powered by FUDForum. Page generated in 0.02037 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software