Supposing that I have a reference to an exi开发者_高级运维stent JavaScriptObject that holds a primitive type, like an int value, how can I get this int value?
Use the JSNI functionality to "adapt" between GWT's Java and underlying Javascript: more specifically, use the cast()
method to adapt to the desired type. You can afterwards "repackage" the object to any Java primitive you want/can.
You might need to write a native
method on a sub-class of JavascriptObject in order to "reach" the primitive type you are referring to. See this article for more details.
精彩评论