|
|
|
|
|
Re: [Xtend2] Problems with method modifiers [message #728052 is a reply to message #727721] |
Thu, 22 September 2011 13:09 |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
Hallvard Traetteberg wrote on Wed, 21 September 2011 23:16You can combine @Inject with extension and get the effect you want:
@Inject extension SomeClass
Since you don't need the field name in the call, you can omit it in the
declaration.
Hallvard
Thanks, I didn't see this option. BTW, there seem to be different versions of Xtend2 syntax, neither the "as" syntax mentioned before, nor omitting the field name worked for me, but that's a minor issue.
Oliver L wrote on Thu, 22 September 2011 14:55
Sometimes it's not possible to impact the creation of an instance of an Xtend class. As the class is not instantiated by Guice MyXtendClass is not injected. Defining static methods in Xtend would bypass this problem, I think.
I agree. So far my experience with Guice in Xtext isn't all sunshine and roses so I'd prefer using less injection rather then more.
thanks for your replies,
Stephan
[Updated on: Thu, 22 September 2011 13:11] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03594 seconds