I would like to a class to request an instance of the key used to bind the 
object itself.  I believe I need to do this to support serialization so 
that I grab the correctly bound object upon reconstruction.

I thought this would work if I did something like the following:

class Foo {
   @Inject Foo(Key<Foo> fooKey) {}
}

But I got a binding error:

Error injecting constructor, java.lang.RuntimeException: Missing type 
parameter.

Is this possible, or would I have to make a custom provider that uses a 
setter to set they key after the object is instantiated?


-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/Cm0sGg1tP1MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to