tags:

views:

354

answers:

1

I have a class that I want to include in a GWT module. Unfortunately, it has a method that has functionality unsupported by GWT (it uses Class.isInstance in case you're curious). I do not use this method in my GWT application, but other non-GWT apps use this method, so I cannot simply remove it. Is there a way to exclude this method in my module definition? Perhaps an annotation on the method can do this?

+3  A: 

There's no functionality in the GWT compiler that lets you do this. It has been discussed in details on the GWT forums, but they decided not to implement it for some very good reasons.

Your only option (since you can't modify the object to remove that method) is to create a transfer object that you use instead of the object that doesn't compile under GWT.

rustyshelf
Yeah, this seems to be the case. I ended up creating this transfer object. Thanks for the prompt response.
P4ndaman
It's kind of funny how GWT can support a subset of functions in a library class, but users cannot do this for classes of their own.
P4ndaman