El 15/01/2010 9:42, motes escribió:
My plan was to let the user specify the int at runtime and then pass it to the module like:public class Test { public static void main(String[] args) { // Get userinput. Path to xml frame. int userInt = Integer.parseInt(args[0]); Injector injector = Guice.createInjector(new MyCarModule (userInt)); CarShop carShop = injector.getInstance(CarShop.class); } }
Perhaps an Assisted Injection is what you are looking for? http://code.google.com/p/google-guice/wiki/AssistedInject http://stackoverflow.com/questions/996300/how-to-use-google-guice-to-create-objects-that-require-parameters Thanks
-- You received this message because you are subscribed to the Google Groups "google-guice" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.
