How to open IType and IMember objects [message #530804] |
Sat, 01 May 2010 03:05  |
Eclipse User |
|
|
|
ICompilationUnit unit=mypackage.getCompilationUnit("SuperClass.java");
ICompilationUnit unit1=mypackage.getCompilationUnit("SubClass.java");
System.out.println("before IMember");
unit.open(null);
unit1.open(null);
IType destinationType=unit.getType("SuperClass.java");
IType sourceType=unit1.getType("SubClass.java");
originalJavaMember=(IMember)sourceType;
//////////////////////////////////////////////////////////// /////////////////
I have written above code, but I am getting the following error:
"Java Model Exception: Java Model Status [SubClass.java [in SubClass.java [in pull [in src [in org.moreunit.plugin]]]] does not exist]"
When I do unit.open it will open the file and I can access all member variables in the project. But when I convert iCompilationUnit into Itype by doing
IType destinationType=unit.getType("SuperClass.java");
The file is no longer opened I get the exception of Java Model. Any hint how to open the Itype and Imember, so that I can get its member methods.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02820 seconds