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.
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
Apparently, the only way to do this presently is to force a run-time error with
a provider method.
I'd like Guice support to force an automatic binding to fail only on a specific
class. I think it could work via requireExplicitBindings() with variable
length parameter list of classes to prohibit.
Original issue reported on code.google.com by glenview...@gmail.com on 19 Jul 2012 at 8:32
Original issue reported on code.google.com by
glenview...@gmail.com
on 19 Jul 2012 at 8:32