java - Guice @Provides in dependent library -


i new googleguice. if understand correctly, create object, need use @provides annotaion on required method in implementation of abstract module. eg:

public class mymodule extends abstractmodule {  @provides public abc abc () { }  @override protected void configure() { }  } 

this has initialized following in main method :

injector injector = guice.createinjector(new mymodule()); 

however, need create object in library called service. therefore, mymodule goes library, whereas main method in service calling library. thus, main method in service have call guice.createinjector mymodule in library.

is there way avoid that?


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -