1

I'm toying around with Guice Introspection in the hopes of building a library that auto-checks guice bindings and requirements as a unit test and pretty prints missing bindings for easier Guicing.

I wrote up a quick ElementVisitor, but I noticed that while the visitor finds and captures @Provider requirements just fine, I don't get any visited elements for bound types with @Inject constructors. Is there a good way to grab these dependencies without building a full injector?

Alternatively, is there an open source library that does something like this already?

Zach H
  • 469
  • 5
  • 18

1 Answers1

1

You may use InjectionPoint.forConstructorOf(Your.class).getDependencies() to get the dependencies associated with the injectable constructor of a particular class.

Alternatively, create an Injector in Stage.TOOL.

Tavian Barnes
  • 12,477
  • 4
  • 45
  • 118