In short you cannot inject the injection point see

http://code.google.com/p/google-guice/issues/detail?id=27

But take a look at http://code.google.com/p/google-guice/wiki/CustomInjections

Feel free to search the mailing list as this was discussed before.

Cheers
Alen

On Feb 19, 9:01 pm, Mark Addleman <[email protected]> wrote:
> I'd like to gain access to an annotation at the injection point within a
> provider.  The idea is that at startup, clients dynamically register names
> of objects.  After startup, clients can gain access to these objects using
> the @Named annotation.  The provider would use the value of @Named to find
> the named object.
>
> Example client code:
> @Inject
> public Constructor(@Named("my-object-name") SomeClass object) {...}
>
> Provider code that I'd like to write:
> public ObjectProvider {
>    public SomeClass get(Annotation a) {
>       // lookup value of a and return it
>    }
>
> }
>
> How can I accomplish this?  I'm sure I'm missing something obvious in the
> docs.
>
> Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
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