I'd like to do something like:
interface Thing{}
class ThingA implements Thing{
@AssistedInject
public ThingA(@Assisted String something, SomeOtherDependencyManagedByGuice 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