Is it possible to limit type hierarchy scanning with Guice?
问题 Is there any way, when using Google's Guice injector to limit inheritance depth when scanning a class to find its dependencies ? I mean, if you define a class A like class A extends X { @Inject private B a; } And I got class inheritance : A --> X --> Y --> Z I just want A to be scanned, and X, but not upper classes like Y and Z. I am pretty certain no fields can be injected in neither classes. My goal is to boost startup phase. Is that possible ? 回答1: I don't think it's possible and I'd bet