Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtext 2.0 / Xtend2] Missing methods in API
[Xtext 2.0 / Xtend2] Missing methods in API [message #684527] Wed, 15 June 2011 18:33 Go to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 114
Registered: October 2010
Senior Member
Hi,

I am using the generated Xtend generator class (implements IGenerator). This uses an JavaIOFileSystemAccess class for actual generation of files. The JavaIOFileSystemAccess has a method to set the output path, that I use.
Later in the generation I want to retrieve the output path from the JavaIOFileSystemAccess object, but there is no getter for the output path. I need this to find out whether files already exist and add special handling for that.

Is there a way to get the output path from the JavaIOFileSystemAccess, or do I need to put an enhancement request in?

Jos
Re: [Xtext 2.0 / Xtend2] Missing methods in API [message #684802 is a reply to message #684527] Thu, 16 June 2011 09:00 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
On 06/15/2011 08:33 PM, Jos Warmer wrote:
> Hi,
>
> I am using the generated Xtend generator class (implements IGenerator).
> This uses an JavaIOFileSystemAccess class for actual generation of
> files. The JavaIOFileSystemAccess has a method to set the output path,
> that I use.
> Later in the generation I want to retrieve the output path from the
> JavaIOFileSystemAccess object, but there is no getter for the output
> path. I need this to find out whether files already exist and add
> special handling for that.
> Is there a way to get the output path from the JavaIOFileSystemAccess,
> or do I need to put an enhancement request in?
>
> Jos

Concerning this issue: how can you modify the default behavior of the
generator so that it uses a different target folder? I mean the
behavior of the generation that is triggered automatically when you save
a file of your DSL (and it uses the src-gen by default).

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
http://www.myspace.com/supertrouperabba
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net


Re: [Xtext 2.0 / Xtend2] Missing methods in API [message #684804 is a reply to message #684527] Thu, 16 June 2011 09:24 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 6/15/11 8:33 PM, schrieb Jos Warmer:
> Hi,
>
> I am using the generated Xtend generator class (implements IGenerator).
> This uses an JavaIOFileSystemAccess class for actual generation of
> files. The JavaIOFileSystemAccess has a method to set the output path,
> that I use.
> Later in the generation I want to retrieve the output path from the
> JavaIOFileSystemAccess object, but there is no getter for the output
> path. I need this to find out whether files already exist and add
> special handling for that.
> Is there a way to get the output path from the JavaIOFileSystemAccess,
> or do I need to put an enhancement request in?
>
> Jos

You can either add an enhancement request or you could add a binding to
IFileSystemAccess, i.e. use your own implementation.

Note that within Eclipse a different implmentation is used, which uses
Eclipse's file system API.

Sven

--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: [Xtext 2.0 / Xtend2] Missing methods in API [message #684806 is a reply to message #684802] Thu, 16 June 2011 09:24 Go to previous message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Am 6/16/11 11:00 AM, schrieb Lorenzo Bettini:
> On 06/15/2011 08:33 PM, Jos Warmer wrote:
>> Hi,
>>
>> I am using the generated Xtend generator class (implements IGenerator).
>> This uses an JavaIOFileSystemAccess class for actual generation of
>> files. The JavaIOFileSystemAccess has a method to set the output path,
>> that I use.
>> Later in the generation I want to retrieve the output path from the
>> JavaIOFileSystemAccess object, but there is no getter for the output
>> path. I need this to find out whether files already exist and add
>> special handling for that.
>> Is there a way to get the output path from the JavaIOFileSystemAccess,
>> or do I need to put an enhancement request in?
>>
>> Jos
>
> Concerning this issue: how can you modify the default behavior of the
> generator so that it uses a different target folder? I mean the
> behavior of the generation that is triggered automatically when you save
> a file of your DSL (and it uses the src-gen by default).
>
> thanks in advance
> Lorenzo
>

You'll have ot override
org.eclipse.xtext.builder.JavaProjectBasedBuilderParticipant or use your
own builder participant.

Sven

--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Previous Topic:Duplicate Names Across Files
Next Topic:tree structure traversal
Goto Forum:
  


Current Time: Wed Apr 24 16:43:31 GMT 2024

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

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

Back to the top