use of com.google.gwt.inject.rebind.GinjectorBindings in project google-gin by gwtplus.
the class BindingInstaller method installBinding.
/**
* Adds the given implicit binding in the graph to the injector hierarchy in the position
* specified by the {@link BindingPositioner}. Also ensures that the dependencies of the implicit
* binding are available at the chosen position.
*/
private void installBinding(DependencyGraph graph, Key<?> key, Binding binding) {
// Figure out where we're putting the implicit entry
GinjectorBindings implicitEntryPosition = positions.getInstallPosition(key);
// Ensure that the dependencies are available to the ginjector
inheritBindingsForDeps(implicitEntryPosition, graph.getDependenciesOf(key));
// Now add the implicit binding to the ginjector
implicitEntryPosition.addBinding(key, binding);
}
use of com.google.gwt.inject.rebind.GinjectorBindings in project google-gin by gwtplus.
the class BindingInstaller method installBindings.
/**
* Installs all of the implicit bindings as described {@link BindingInstaller above}.
*
* @param output {@link DependencyExplorerOutput} with information about the unresolved bindings
* for the current ginjector.
*/
public void installBindings(DependencyExplorerOutput output) {
positions.position(output);
// Install each implicit binding in the correct position
for (Map.Entry<Key<?>, Binding> entry : output.getImplicitBindings()) {
installBinding(output.getGraph(), entry.getKey(), entry.getValue());
}
// Make sure that each of the dependencies needed directly from the origin are available
GinjectorBindings origin = output.getGraph().getOrigin();
inheritBindingsForDeps(origin, origin.getDependencies());
}
Aggregations