Is in-memory output possible with ATL/EMFTVM ? [message #1709589] |
Tue, 29 September 2015 08:43  |
Eclipse User |
|
|
|
Hi,
I've managed to get a standalone ATL/EMFTVM example running, based on the code written here
However, all the examples, including the wiki, work via reading and writing files.
I can deal with the read scenario, but the target model requires a call to setResource with a file resource. It appears that this resource is then used to add target content. My problem is, I don't want to write a file. I'd like to use an in memory target, such as a ByteArrayOutputStream, but can't do that, because I can't find a way to create an in-memory resource that will not throw an exception when ATL/EMFTVM code calls getContents on it.
I think I'm missing here something, because I can't be the only one who'd like to write a service that exposes ATL/EMFTVM functionality over the network.
Regards
Sarikan
|
|
|
Re: Is in-memory output possible with ATL/EMFTVM ? [message #1709601 is a reply to message #1709589] |
Tue, 29 September 2015 09:34  |
Eclipse User |
|
|
|
To answer my own question: the resource of the output model is accessible to us, and this code gives us a nice string representation of the output:
ByteArrayOutputStream out = new ByteArrayOutputStream();
outModel.getResource().save(out,null);
String temp = new String(out.toByteArray());
I was (incorrectly) under the assumption that creating a file resource implies creating a file. That is of course not the case, the file would not be created until we call .save on the output model's resource.
|
|
|
Powered by
FUDForum. Page generated in 0.25434 seconds