I'd like to do something like:
interface Thing{}
class ThingA implements Thing{
@AssistedInject
public ThingA(@Assisted String something, SomeOtherDependency
ManagedByGuice foo){
// ...
}
}
// need a factory for ThingA and ThingB? What does this/these look like?
public MyApp(Map<String,ThingFactory> f){
ThingA thing = g.get('thing-type-a").create("something");
}
In that case, "thing-type-a" is a String/Key pointing to some factory
instance in the map (used for creating a ThingA), and "something" is a
user-assisted/runtime argument to the factory "create" method. I have map
binding working with a factory but how do I then get assisted inject to
work on the actual implementations of Thing? Could someone post a full
example of how to do this? I can't seem to find a complete working example
of how to do this.
Thanks,
- Matt
--
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 https://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/da416bd2-043a-4f7a-9c09-33396469a025%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.