Skip to main content


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 14:05 Go to next message
Oren Mishali is currently offline Oren MishaliFriend
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 14:48 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 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 06:44 Go to previous message
Oren Mishali is currently offline Oren MishaliFriend
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: Thu Apr 18 23:31:20 GMT 2024

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

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

Back to the top