I see there used to be a JsoList that is an overlay type
implementation of java.util.List but it was deleted in r8918 (see
http://code.google.com/p/google-web-toolkit/source/detail?r=8918 and
associated code review) last October. I can't find the reason why?
Background: I would like to return a List from an overlay type so
there is consistent implementation between that and the server-side
impl, e.g.:
interface Warehouse { List<Widget> getWidgets(); }
class WarehouseImpl implements Warehouse { final List<Widget>
getWidgets() { /* ... get widgets from model ... */ }
}
class WarehouseJso extends JavaScriptObject implements Warehouse {
public final native List<Widget> getWidgets() /*-{
// ... eval JSON data from server listing Widgets ...
}-*/;
}
It seems that the now-defunct JsoList might do what I want but I
discovered it was deleted (apparently) in r8918 and I imagine there
was a good reason for this. This would indicate I should abandon my
overlay-types-return-java-collections idea as there are presumably
drawbacks.
Background of background: The client-side code is reading a JSON array
of items, but I'd like to treat these in code as a plain list rather
than a JsArray which is too JS-specific and doesn't allow for-each
loops etc.
--
Ash
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors