| java.lang.Object com.google.gwt.dev.shell.JsValueGlue
JsValueGlue | public class JsValueGlue (Code) | | Glue layer that performs GWT-specific operations on JsValues. Used to isolate
HostedModeExceptions/etc from JsValue code
|
Method Summary | |
public static T | createJavaScriptObject(JsValue value, Class<? extends T> type) Create a JavaScriptObject instance referring to this JavaScript object. | public static T | get(JsValue value, Class<? extends T> type, String msgPrefix) Return an object containing the value JavaScript object as a specified
type. | public static JsValue | getUnderlyingObject(Object jso) Returns the underlying JsValue from a JavaScriptObject instance.
The tricky part is that it is in a different classloader so therefore can't
be specified directly. | public static void | set(JsValue value, CompilingClassLoader cl, Class> type, T obj) Set the underlying value. |
createJavaScriptObject | public static T createJavaScriptObject(JsValue value, Class<? extends T> type)(Code) | | Create a JavaScriptObject instance referring to this JavaScript object.
The caller is responsible for ensuring that the requested type is a
subclass of JavaScriptObject.
Parameters: type - The subclass of JavaScriptObject to create the constructed JavaScriptObject |
get | public static T get(JsValue value, Class<? extends T> type, String msgPrefix)(Code) | | Return an object containing the value JavaScript object as a specified
type.
Parameters: value - the JavaScript value Parameters: type - expected type of the returned object Parameters: msgPrefix - a prefix for error/warning messages the object reference throws: HostedModeException - if the JavaScript object is not assignable tothe supplied type. |
getUnderlyingObject | public static JsValue getUnderlyingObject(Object jso)(Code) | | Returns the underlying JsValue from a JavaScriptObject instance.
The tricky part is that it is in a different classloader so therefore can't
be specified directly. The type is specified as Object, and reflection is
used to retrieve the hostedModeReference field.
Parameters: jso - the instance of JavaScriptObject to retrieve the JsValue from. the JsValue representing the JavaScript object |
set | public static void set(JsValue value, CompilingClassLoader cl, Class> type, T obj)(Code) | | Set the underlying value.
Parameters: value - JsValue to set Parameters: type - static type of the object Parameters: obj - the object to store in the JS value |
|
|