Hi all,
My team in in transition from Spring to Guice, and I'm using
SpringIntegration#bindAll to translate our Spring XML to Guice
bindings. The problem I'm running into is that the Spring bindings to
not include generic type information. So a property defined like:
class MyClass {
@Inject List<String> myList;
}
will not be injected because the binding from Spring only specifies
the raw List class.
My attempted solution was to write a TypeListener which could register
a new MembersInjector to inject fields based only on the raw type,
assuming the corresponding binding exists. However this is not
possible, because TypeListener#hear is not called until after Guice
attempts to inject MyClass, which fails because there is no binding
for List<String>. This happens whether the binding is JIT or normal.
Is there any way to create the necessary bindings like this on an as-
needed basis? Alternatively, can anyone recommend a working migration
path from Spring XML to Guice?
--
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.