Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Is it possible to generate Java code from a resource only loaded in memory? (MoDisco - Acceleo)
Is it possible to generate Java code from a resource only loaded in memory? [message #1802452] Sat, 09 February 2019 07:17
Pablo Gomez Abajo is currently offline Pablo Gomez AbajoFriend
Messages: 8
Registered: February 2019
Junior Member
Hi,

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:

JavaPackage.eINSTANCE.eClass();
GenerateJavaExtended javaGenerator = new GenerateJavaExtended(model, new File(folder), new ArrayList<Object>());
javaGenerator.doGenerate(null);


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,

Pablo
Previous Topic:Every attribute is marked as public
Next Topic:Generate Java code from a Java model
Goto Forum:
  


Current Time: Sun Nov 29 05:44:16 GMT 2020

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

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

Back to the top