I think what Stuart is saying is that the Binding itself doesn't expose the
info because, well, it doesn't have the info.  You need to use
theAssistedInject SPI
extension<https://code.google.com/p/google-guice/wiki/AssistedInject#Inspecting_AssistedInject_Bindings_(new_in_Guice_3.0)>to
get the info you want.  The
getAssistedMethod<http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/assistedinject/AssistedInjectBinding.html>method
should expose the info you want in
AssistedMethod<http://google-guice.googlecode.com/svn/trunk/javadoc/com/google/inject/assistedinject/AssistedMethod.html>
.

 sam


On Wed, Aug 21, 2013 at 2:00 PM, <[email protected]> wrote:

> Stuart, what you say makes perfect sense. But I didn't find how to access
> the implementation type from the Binding. I think the problem is that *
> com.google.inject.internal.ConstructorBindingImpl* is not public so I
> can't cast the binding to it to access the *constructorInjectionPoint*. I
> guess I could use some reflection workarounds here, but I would prefere
> not. Maybe there is another way to get that implementation type?
>
> This is what I see when breaking into the *matches()* method, *ClassAAA*is 
> there, I just don't know how to access it :
>
> http://i.imgur.com/WDVDiPb.png
>
> Thanks in advance if you look into that issue when you're back. And have
> some good vacations!
>
>
>
> On Wednesday, August 21, 2013 1:16:30 PM UTC-4, Stuart McCulloch wrote:
>>
>> I'm on vacation atm without access to a pc, but afaict you're matching on
>> Binding.getKey which is the "from" part of the binding. Without
>> assistedinject there will be a just-in-time untargetted binding that
>> matches; ie the implementation type, equivalent to bind(MyImpl.class);
>>
>> With assistedinject the implementation is hidden inside the factory
>> binding, which is why the matcher no longer matches unless you add the
>> init'able interface to the binding interface.
>>
>> IIRC it is possible get the implementation type from the assistedinject
>> SPI binding type and from there look for the init'able interface. Should
>> just be a matter of extending your matcher to be aware of other more
>> specific binding types.
>>
>> Will take a closer look when I get back.
>>
>> ********
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-guice.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to