The reason this is a low priority for the GWT team is because reflection goes against the "spirit" of GWT. It introduces a lot of problems that are difficult to deal with in a fashion that would result in speedy client-side code. My suggestion would be to work around it, but if you would like help, you can post your code here and I'll take a look at it.
On Apr 28, 4:03 am, andrej <[email protected]> wrote: > Wrote the following code, and then realized that I can't translate > this to javascript: > > public <T extends Entity> T create(Class<T> type, long id) { > T t = type.newInstance(); > t.setId(id); > return type.cast(t); > } > > Two problems: > (1) Class.newInstance not implemented > (2) Class.cast not implemented > > Class.cast should be easy to implement, since it's pretty much just an > identity function. I.e. > type.cast(t) --> t > > Class.newInstance() seems also relatively easy to implement. Just > another prototype function to > the class literal object? > > This is regarding the following > issue:http://code.google.com/p/google-web-toolkit/issues/detail?id=487&can=... > > It's apparently low priority. But it seems it could be implemented > easily. Am I wrong? Can I add this > functionality myself? Any pointers? Unfortunately I'm just getting > started with GWT, so I don't have > a good understanding of how this works under the hood yet. > > Thank you --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
