That worked, thanks Fred. The only annoying thing was that I had to
create an index of existing bindings, which normally I would just use
the Injector for, but it turned out alright.

On Mar 30, 11:31 pm, Fred Faber <[email protected]> wrote:
> Jason,
>
> I was suggesting to iterate over the Elements of a Module, before an
> Injector is created.
>
> http://www.google.com/codesearch/p?hl=en#vY65eMZAf-c/src/com/google/i...
>
> Had you considered that?
>
> regards
> Fred
>
>
>
>
>
>
>
> On Wed, Mar 30, 2011 at 5:25 PM, JasonQR <[email protected]> wrote:
> > Hi Fred,
>
> > That's the problem in a nutshell.
>
> > I did try an SPI-based solution, but because any type that Guice has a
> > binding for is instantiated (and fails) it's not an option to iterate
> > over the bindings and add new ones, unfortunately.
>
> > --Jason.
>
> > On Mar 30, 4:52 pm, Fred Faber <[email protected]> wrote:
> > > If you have a mapping of raw binding => generically typed binding, then
> > you
> > > could iterate over the Elements of the Module you create using the SPI
> > order
> > > to add bindings for those generically typed values.  That is, you could
> > > replace a binding for List with a binding for List<String>
> > programmatically
> > > as long as you knew you wanted List<String> and not, e.g., List<Integer>.
> > >  Though this begs the question:  how would you know what these mappings
> > are?
> > >  And if you had that information, I wonder if it wouldn't be easier to
> > use
> > > it directly.
>
> > > Fred
>
> > > On Wed, Mar 30, 2011 at 10:46 AM, [email protected] <[email protected]
> > >wrote:
>
> > > > Unfortunately you'll need to create a binding with full generic type
> > > > information. Type listeners cannot create new bindings.
>
> > > > --
> > > > 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.
>
> > --
> > 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.

-- 
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