Binder.requireExplicitBindings On Thu, Jul 19, 2012 at 12:20 PM, glenviewjeff <[email protected]>wrote:
> Also posted on Stack Overflow <http://stackoverflow.com/q/11564353/403455> > > I'm using a couple of different injectors and I want to ensure I don't > accidentally access a class that's bound automatically from an injector, > especially since its scope is important. > > Is there a way I can force an automatic binding to fail, or at least > report a run-time error? > > For instance if I have a method Foo that is "illegally" requesting a Bar: > > class Bar { @Inject Bar() {} } // Shouldn't be accessible in Foo's injector > class Foo { @Inject Foo(Bar bar) {} } // Binding should fail here > > > -- > You received this message because you are subscribed to the Google Groups > "google-guice" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-guice/-/dPLIkgQMVngJ. > 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. > -- 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.
