For the record, here is how to do it:

1. Use a method like InjectionPoint.forInstanceMethodsAndFields() and
pick the injection point of interest from the returned Set; say we
choose a field
2. Get the field's Key with InjectionPoint.getDependencies().get
(0).getKey()
3. Ask the Injector for a matching value with Injector.getInstance
(Key)
4. Manually inject the value

Cheers,
Peter

On Sep 9, 5:14 am, Peter Niederwieser <[email protected]> wrote:
> On closer look, it seems that custom injections still won't give me
> control over which InjectionPointS get injected, because Guice always
> injects whatever it can first. So the original question still stands:
> Given a set of InjectionPointS, is it possible to inject just these
> injection points? I could do the actual injection myself, as long as
> Guice provided me with the values to inject.
>
> Cheers,
> Peter
>
> On Sep 9, 4:07 am, Peter Niederwieser <[email protected]> wrote:
>
>
>
> > > Yep, that's the way to go. Take a look at our custom injections docs:
> > >  http://code.google.com/p/google-guice/wiki/CustomInjections
>
> > That solves my problem. Thanks!
> > (By the way, it would be nice to have something like
> > Injector.injectMember(InjectionPoint, Object). Then I wouldn't need
> > the more sophisticated custom injection stuff.)
>
> > Cheers,
> > Peter
--~--~---------~--~----~------------~-------~--~----~
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