My question is similar to Eclipse create CompilationUnit from .java file however I don't have a file and I would like to create a handle for a CompilationUnit with given contents without actually creating underlying resources.
The actual goal is to get an object of type org.eclipse.jdt.core.IType
, so using setSource(char[] source)
doesn't solve the problem since there are no bindings in the resulting AST.
Do I necessary have to create a temporary file to fulfill my requirement?