title: How do you make dynamic bindings in Guice that require an injected Instance?
body: <p>I'd like to create a Module that dynamically binds instances to named annotations. The use case is I would like to automatically bind the values in my configuration with the key in the properties file being the @Named value.</p>
  
  <p>However the configuration is bound in a different module so I need the config to be injected. Solutions I've looked at are:</p>
  
  <ol>
  <li><p>Binding in the configure() method. 
  This method is not injected into and I can not get the base configuration.</p></li>
  <li><p>Using a Provider/@Provides.
  Providers only bind a single instance.</p></li>
  <li><p>Using MultiBinder.
  My use case is a little different then what is provided by this extension. Multi-binding allows you to bind multiple instances separately and then have them injected as a Collection more complex containing type. I would like to bind each instance separately and have them by uniquely identifiable for injection latter.</p></li>
  <li><p>Use a childInjector.
  Unfortunately this isn't possible without some extensive modification of existing code. <a href="https://stackoverflow.com/questions/12774020/guice-how-to-bind-classes-that-are-dynamically-obtained-by-an-already-binded-o">This answer</a> is a very good description of how to solve this problem this way though.</p></li>
  <li><p>Inject the binder somehow. (I started getting a little hackier)
  Guice allows injecting the Injector for latter use, I tried injecting the Binder into the Module though a @Provides method and then using the binder directly to make multiple binds within the method. Guice would not inject the binder.</p></li>
  </ol>