Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] how to create a temporary working copy for a nonexisting cu?

hi,
i'm not sure if i'm not missing something really easy here:

i'm trying to perform some operation that requires an ICompilationUnit.
the thing is that this ICompilationUnit does not exist - i have its source and name but it does not exist on the disk.

so the question is: how do i get a handle to an not-existing ICompilationUnit (can be a working copy) and set its contents?
IPackageFragment::getCompilationUnit(String) gives me a handle but then calling getBuffer() (i wanted to call setContents(String) on
the buffer)
results in a JavaModelException

will i have to resort to temporarily creating the thing on the disk and deleting afterwards? hope not as that would be not pretty.

merci
a.



Back to the top