Marker interface. To export a class to Javascript, perform the following
steps:
- add Exportable as an implemented interface
- Choose between a
whitelist or blacklist export policy
- If blacklist, add @gwt.export to the
JavaDoc of the class definition and use @gwt.noexport for any methods you do
not wish to be exported. By default, all public methods and static final
fields are exported.
- If whitelist, add @gwt.export to each method, field,
constructor you wish to export.
- use @gwt.exportPackage foo.bar to
override the generated Javascript package hierarchy
- If two methods have
the same export name, you can resolve the conflict by renaming the exported
method, e.g. "@gwt.export addDouble" will export method add(double, double)
as addDouble(double,double)
Finally, somewhere in your entry point class, perform the following:
Exporter exporter = (Exporter)GWT.create(MyClass.class);
exporter.export();