Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » dependency injection in Xtext source code(understanding dependency injections in Xtext source code )
dependency injection in Xtext source code [message #1017032] Fri, 08 March 2013 17:14 Go to next message
e r is currently offline e rFriend
Messages: 4
Registered: March 2013
Junior Member
Hello,

In the classes org.eclipse.xtext.xtext.ui.wizard.project.XtextProjectCreator and org.eclipse.xtext.ui.wizard.AbstractProjectCreator of the source code of Xtext, the three following fields are instantiated using dependency injection:

@Inject
@Named("file.extensions")
private String fileExtension;

@Inject
private Provider<PluginProjectFactory> projectFactoryProvider;

@Inject
private Provider<FeatureProjectFactory> featureProjFactoryProvider;

What are the classes in the source code of Xtext that specifies how to instantiate these three fields? I think that these classes should implement "com.google.inject.Module" or inherit from another class that implements "com.google.inject.Module". However, there are so many classes in the source code of XText that I have been unable to locate these classes.

Any help would be appreciated.

Thanks in advance for any answer.
Re: dependency injection in Xtext source code [message #1017050 is a reply to message #1017032] Fri, 08 March 2013 18:36 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

entrypoint for guice are: the activator in the ui project and the standalonesetup in the runtime project
they make use of yourdslruntimemodule and yourdsluimodule (and other modules)
have a look at
http://www.eclipse.org/Xtext/documentation.html#dependencyInjection
http://koehnlein.blogspot.de/2012/11/xtext-tip-how-do-i-get-guice-injector.html


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: dependency injection in Xtext source code [message #1017330 is a reply to message #1017050] Mon, 11 March 2013 15:45 Go to previous message
e r is currently offline e rFriend
Messages: 4
Registered: March 2013
Junior Member
Thanks, your answer helped me to find what I was looking for.
Previous Topic:How to avoid including ecore for dsl and load dynamically using Namespace uri of the ecore ?
Next Topic:fornax-oaw-m2-plugin extended generator
Goto Forum:
  


Current Time: Tue Apr 23 12:51:42 GMT 2024

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

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

Back to the top