java - Explore an Array in GWT without knowing its type -
java - Explore an Array in GWT without knowing its type -
i building generic visualizer of objects gwt. this, using reflection capabilities offered gwt-ent. can explore methods , fields , that's plenty classes. 1 problem still have gwt-ent not allow me explore arrays. gives me type of components, not get() or set() method, java.lang.reflection.array does.
so have used native java.lang.reflection.array, curiously works when in debug mode (how possible?), when go production mode compiler complains.
i have tried tricks, instance converting array arraylist java.utils.array.aslist(t... a) there's not way making work. have seen similar problem here. in case 1 of suggestion import jsni method provided byt com.google.gwt.lang.array.createfrom(..), can see in the source code class unfortunately has set() method no get() method !
the question is: see way accessing element of array without knowing type of array in advance?
reflection not supported in gwt compiled. can work in dev-mode because of code when debugging run in jvm instead of browser.
i suggest, modify gwt-ent generator match requirements , send patch author contribution, or maybe alter gwt-ent other 3party library gwt-reflector.
another interesting gwt reflection project i've found gwt-processor seems not utilize generators.
java arrays gwt reflection
Comments
Post a Comment