I'm trying to use AssistedInject with Gin in GWT 2.4.0:
public interface ElevatorButtonFactory {
ElevatorButton create(int shownFloorNumber, Action<Integer> onClick);
}
@Inject
ElevatorButton(GameHost gameHost, @Assisted int shownFloorNumber,
@Assisted Action<Integer> onClick) {
// ...
}
In my Gin module:
install(new GinFactoryModuleBuilder().implement(ElevatorButton.class, ElevatorButton.class)
.build(ElevatorButtonFactory.class));
That seems like it should be sufficient, right? But when I try to take ElevatorButtonFactory
as an injected parameter, I get the following error:
[ERROR] [foo] - Deferred binding result type 'com.foo.html.client.components.floorpicker.ElevatorButton.ElevatorButtonFactory' should not be abstract
What am I doing wrong?
It seems like that problem is not about GIN. It's about how do you use your
ElevatorButtonFactory
class. Your injector interface should look like this:Create
ElevatorButton
instance:May be you try to instantiate your factory via GWT.create() or something else? If the problem will not gone - let me look at the full stacktrace.