Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to define a 'synchronized' method using the model inferrer
How to define a 'synchronized' method using the model inferrer [message #1060821] Tue, 28 May 2013 10:05 Go to next message
Oren Mishali is currently offline Oren Mishali
Messages: 15
Registered: March 2013
Junior Member
Hi all,
I'm using the model inferrer in order to map elements in a model into Java methods. E.g., I have this code:

...
members += model.toMethod("foo", model.newTypeRef(Void::TYPE)) [
body = [ append('''...''') ]
...


Is it possible to define the above Java method as 'synchronized'? I hope it is...

Thanks!
Oren

Re: How to define a 'synchronized' method using the model inferrer [message #1060831 is a reply to message #1060821] Tue, 28 May 2013 10:48 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1322
Registered: July 2009
Senior Member
On 05/28/2013 04:05 PM, Oren Mishali wrote:
> Hi all,
> I'm using the model inferrer in order to map elements in a model into
> Java methods. E.g., I have this code:
>
>
> ..
> members += model.toMethod("foo", model.newTypeRef(Void::TYPE)) [
> body = [ append('''...''') ]
> ..
>
>
> Is it possible to define the above Java method as 'synchronized'? I hope
> it is...

Just inspect the JvmOperation and you can see the get/setSynchronized :)

members += model.toMethod("foo", model.newTypeRef(Void::TYPE)) [
body = [ append('''...''') ]
synchronized = true


--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Re: How to define a 'synchronized' method using the model inferrer [message #1060910 is a reply to message #1060831] Wed, 29 May 2013 02:44 Go to previous message
Oren Mishali is currently offline Oren Mishali
Messages: 15
Registered: March 2013
Junior Member
Thanks!
I missed that since I'm using Xtext 2.3 (set/getSynchronized are only available since 2.4). It is the time to update...
Oren
Previous Topic:Add my var in Quick Reference
Next Topic:Correct Indentation
Goto Forum:
  


Current Time: Sat Aug 23 07:35:26 EDT 2014

Powered by FUDForum. Page generated in 0.01800 seconds