Comment #3 on issue 758 by [email protected]: Increase support for
optional injection.
http://code.google.com/p/google-guice/issues/detail?id=758
Hmm, yeah that seems to work just fine. For anyone reading I did this:
val injectorProvider = getProvider(classOf[Injector])
val provider = if (anno.required()) encounter.getProvider(k) else new
Provider[AnyRef]() {
def get(): AnyRef = try { injectorProvider.get().getInstance(k) } catch {
case e: Exception => null }
}
Any chance you happen to know which injector I get? For example, if I have
a private module and I save off a provider for the injector, can I use that
injector to get access to non-exposed objects?
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/groups/opt_out.