Skip to main content



      Home
Home » Modeling » TMF (Xtext) » @Inject usage in Xtend files
@Inject usage in Xtend files [message #918726] Fri, 21 September 2012 05:34 Go to next message
Eclipse UserFriend
Hi,

I have a custom qualified name provider 'MyDslQualifiedNameProvider'(java file) and want this to be used in one of the xtend files. I have added the below code in xtend file

@Inject
MyDslQualifiedNameProvider qualifiedNameProvider


but I get a null pointer exception. What is wrong? How can we use Guice in Xtend files?

Any help is greatly appreciated.

Thanks,
Latha
Re: @Inject usage in Xtend files [message #918739 is a reply to message #918726] Fri, 21 September 2012 05:41 Go to previous messageGo to next message
Eclipse UserFriend
Hi this works out of the box. Just make sure your instance is created
by guice

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de
Re: @Inject usage in Xtend files [message #918766 is a reply to message #918739] Fri, 21 September 2012 06:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi Christian,

What do you mean by

Quote:

Make sure instance is created by Guice


Regards,
Latha

[Updated on: Fri, 21 September 2012 06:23] by Moderator

Re: @Inject usage in Xtend files [message #918786 is a reply to message #918766] Fri, 21 September 2012 06:45 Go to previous message
Eclipse UserFriend
Hi,

you did not post any context how you call your xtend class.
the instance of the xtend class you use must be
created/injected with guice.
how this is best done depends on your actual usecase

~Christian
Previous Topic:Large Files and Excluding Directories
Next Topic:I need both ImportUriGlobalScopeProvider and TypesAwareDefaultGlobalScopeProvider in my DSL
Goto Forum:
  


Current Time: Sun Jul 06 01:03:14 EDT 2025

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

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

Back to the top