Joe DeSantis
2018-06-20 20:45:44 UTC
I was working with a JUnit 5 extension for Guice, and we had the need to
determine if a particular class was able to be injected by an injector.
The only solution we came up with is attempting to get an instance with
that Injector. (Literally calling the getInstance method, in a try/catch
block).
So my question is simply, what is the best way of determining if you can
get an instance of a particular class given an injector.
The discussion on the implementation is here for anyone who is curious,
https://github.com/JeffreyFalgout/junit5-extensions/commit/adf2f4ece977e834ba9b4f1563ebc568784ad3a4#commitcomment-29425765
Thanks!
determine if a particular class was able to be injected by an injector.
The only solution we came up with is attempting to get an instance with
that Injector. (Literally calling the getInstance method, in a try/catch
block).
So my question is simply, what is the best way of determining if you can
get an instance of a particular class given an injector.
The discussion on the implementation is here for anyone who is curious,
https://github.com/JeffreyFalgout/junit5-extensions/commit/adf2f4ece977e834ba9b4f1563ebc568784ad3a4#commitcomment-29425765
Thanks!
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/dbbc0674-7e82-47de-97ee-6bdf9258d2fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-guice+***@googlegroups.com.
To post to this group, send email to google-***@googlegroups.com.
Visit this group at https://groups.google.com/group/google-guice.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-guice/dbbc0674-7e82-47de-97ee-6bdf9258d2fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.