user1539137
user1539137

Reputation: 369

gwt-exporter: Exporting interfaces

I have a project in GWT that I am trying to export to javascript using GWT-exporter. The problem is that I have an interface which I need to export and have the client provide implementations for the methods. For example:

@Export

public interface Listener extends Exportable{
    public void method1();

    public void method2();
}

Could somebody please help me with this? If I can't export this, how should I go about solving this problem? I don't know much javascript, so any suggestions will help. Thanks!!

Upvotes: 2

Views: 355

Answers (1)

You can export an interface and export methods using it, but you cannot instantate an object of it from js unless you export a class as well. If you want to provide the implementation of the mehod using a js function you have to use the @ExportClosure annotation.

Upvotes: 1

Related Questions