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=1&q=newInstance

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 Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to