Exportable and @Export

15 views
Skip to first unread message

Jay

unread,
Feb 13, 2013, 7:42:52 PM2/13/13
to gwtex...@googlegroups.com
I'm curious what the reason is behind having to annotate a class as @Export *and* having to implement the Exportable interface.

I can understand there may be cases for it (e.g., you don't want to export the whole class?) but I would have thought that the presence of the annotation could have (effectively) done the same thing as implementing the interface.

I'd be happy to get a pointer into some of the code where I can look and get see how each of these are used.

Thanks,

jay

Manuel Carrasco Moñino

unread,
Feb 14, 2013, 8:38:07 AM2/14/13
to gwtex...@googlegroups.com
We use the Exportable interface to call in compile time the gwt-exporter generator, take a look to the Exporter.gwt.xml module file:

<generate-with class="org.timepedia.exporter.rebind.ExporterGenerator">
    <when-type-assignable class="org.timepedia.exporter.client.Exportable"/>

We use the @Export annotation to know which methods to export, when the @Export is at class level all methods of the class will be exported, otherwise you have to annotate with @Export just the methods you want.

- Manolo
 

--
Has recibido este mensaje porque estás suscrito al grupo "gwtexporter" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus correos electrónicos, envía un correo electrónico a gwtexporter...@googlegroups.com.
Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
 
 

Jay

unread,
Feb 14, 2013, 12:11:27 PM2/14/13
to gwtex...@googlegroups.com
I guess my question is more like... If you mark a class as @Export, couldn't the annotation processing turn that into the same thing as if I had manually written "implements Exportable"?

Basically, I'm wondering if there's an opportunity to write a little bit less code ;-)

Thanks!

jay

Manuel Carrasco Moñino

unread,
Feb 14, 2013, 1:16:41 PM2/14/13
to gwtex...@googlegroups.com
AFAIK the only way to run a gwt generator is implementing an interface.
There and issue opened and  a patch sent to support annotations [1], but I suspect it is not in the current gwt version.


- Manolo


--

Jay

unread,
Feb 15, 2013, 1:43:05 AM2/15/13
to gwtex...@googlegroups.com
Thanks for that pointer.
Reply all
Reply to author
Forward
0 new messages