Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How to generate into a string instead of a file with xpand?
How to generate into a string instead of a file with xpand? [message #487591] Wed, 23 September 2009 16:32 Go to next message
Michael Scharf is currently offline Michael Scharf
Messages: 298
Registered: July 2009
Senior Member
Hi,

is it possible to use an xpand template and to generate
directly into a string(buffer/stream) instead of a file?
Or do I have to generate into a tmp file and then read
that file into a string?

Michael
--
Michael Scharf
Wind River Systems GmbH
http://www.WindRiver.com
http://MichaelScharf.blogspot.com/
Re: How to generate into a string instead of a file with xpand? [message #487704 is a reply to message #487591] Thu, 24 September 2009 08:12 Go to previous message
Sebastian Zarnekow is currently offline Sebastian Zarnekow
Messages: 2832
Registered: July 2009
Senior Member
Hi Michael,

there are some possibilities to achieve this. First of all, you'll have
to dig into the code and get an idea about the xpand concepts output,
outlet, postprocessor or vetostrategy.

One possiblity is to implement an own output that is file agnostic. The
methods openFile and closeFile don't refer to java.io.File but to the
xpand file statement.

Another way would be to implement a postprocessor and vetostrategy and
configure your outlet. The vetostrategy would answer with false while
the postprocessor can process the buffer of the file handle.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Michael Scharf schrieb:
> Hi,
>
> is it possible to use an xpand template and to generate
> directly into a string(buffer/stream) instead of a file?
> Or do I have to generate into a tmp file and then read
> that file into a string?
>
> Michael
Previous Topic:Update from oaw4 to Eclipse modelling - EMFChecker problem
Next Topic:[JET] Xpath position()
Goto Forum:
  


Current Time: Sun Sep 21 20:24:51 GMT 2014

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

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