Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » [Xtend2] How to write anonymous inner class?
[Xtend2] How to write anonymous inner class? [message #778207] Wed, 11 January 2012 16:42 Go to next message
Daniel Wolf is currently offline Daniel WolfFriend
Messages: 1
Registered: January 2012
Junior Member
Hi! I realize that I can use closures to implement interfaces / extend base classes with only one method.
To do the same for interfaces / base classes with multiple methods, Java supports anonymous inner classes. This way, I can capture values from the surrounding method, reducing boilerplate code.

How can I do the same thing in Xtend?
Re: [Xtend2] How to write anonymous inner class? [message #778234 is a reply to message #778207] Wed, 11 January 2012 20:50 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14670
Registered: July 2009
Senior Member
Hi,

no this is currently not possible.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xtend2] How to write anonymous inner class? [message #778421 is a reply to message #778207] Wed, 11 January 2012 16:57 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Daniel,

it's currently not supported in Xtend.

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

Am 11.01.12 17:42, schrieb Daniel Wolf:
> Hi! I realize that I can use closures to implement interfaces / extend
> base classes with only one method.
> To do the same for interfaces / base classes with multiple methods, Java
> supports anonymous inner classes. This way, I can capture values from
> the surrounding method, reducing boilerplate code.
>
> How can I do the same thing in Xtend?
Previous Topic:outline
Next Topic:content assist across files
Goto Forum:
  


Current Time: Sat Apr 27 04:20:01 GMT 2024

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

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

Back to the top