|Is it possible to generate Java code from a resource only loaded in memory? [message #1802418]
||Fri, 08 February 2019 14:40
| Pablo Gomez Abajo
Registered: February 2019
I would like to know if it is possible to generate Java code form a resource loaded in memory and not stored in the disk with MoDisco.
I would like to do something like this:
GenerateJavaExtended javaGenerator = new GenerateJavaExtended(model, new File(folder), new ArrayList<Object>());
where the model variable is the resource obtained after applying the MoDisco discoverer to a Java project, which is loaded in memory and modified, and not stored in the disk after these modifications (The expected behavior is that these modifications will be reflected in the generated Java code).
I know there is a version of this GenerateJavaExtended method which accepts an EObject as the first parameter, and I tried to pass the root object of the Java project model as this first argument but didn't manage to make it work.
I manage to make this work but when I serialize the model onto the disk after applying the modifications, and passing the resource's URI as the first argument:
GenerateJavaExtended javaGenerator = new GenerateJavaExtended(model.getURI(), new File(folder), new ArrayList<Object>());
I would appreciate any help. Many thanks in advance,
Powered by FUDForum
. Page generated in 0.01919 seconds