public class JsoEval
extends java.lang.Object
JavaScriptObjects
.
Because devmode does extensive rewriting of JSO bytecode, debuggers can't
figure out how to evaluate JSO method calls. This class can be used directly
by users to evaluate JSO methods in their debuggers. Additionally, debuggers
with GWT support use this class to transparently evaluate JSO expressions in
breakpoints, watch windows, etc.
Example uses:
JsoEval.call(Element.class, myElement, "getAbsoluteTop");
JsoEval.call(Node.class, myNode, "cloneNode", Boolean.TRUE);
JsoEval.call(Element.class, element.getFirstChildElement(), "setPropertyString", "phase",
"gamma");
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
call(java.lang.Class klass,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object... args)
Reflectively invokes a method on a JavaScriptObject.
|
static java.lang.Object |
call(java.lang.Class klass,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Object... args)
A convenience form of
call(Class, Object, String, Class[], Object...) for use directly
by users in a debugger. |
static java.lang.Object |
callEx(java.lang.Class klass,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object... args)
Reflectively invokes a method on a JavaScriptObject.
|
static java.lang.Object |
callEx(java.lang.Class klass,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Object... args)
A convenience form of
call(Class, Object, String, Class[], Object...) for use directly
by users in a debugger. |
static java.lang.Object |
callStatic(java.lang.Class klass,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object... args)
Reflectively invokes a static method on a JavaScriptObject.
|
static java.lang.Object |
callStaticEx(java.lang.Class klass,
java.lang.String methodName,
java.lang.Class[] types,
java.lang.Object... args)
Reflectively invokes a static method on a JavaScriptObject.
|
public static java.lang.Object call(java.lang.Class klass, java.lang.Object obj, java.lang.String methodName, java.lang.Class[] types, java.lang.Object... args)
klass
- Either a class of type JavaScriptObject or an interface
implemented by a JavaScriptObject. The class must contain the method to
be invoked.obj
- The JavaScriptObject to invoke the method on. Must be null if
the method is static. Must be not-null if the method is not staticmethodName
- The name of the methodtypes
- The types of the argumentsargs
- The values of the argumentspublic static java.lang.Object call(java.lang.Class klass, java.lang.Object obj, java.lang.String methodName, java.lang.Object... args)
call(Class, Object, String, Class[], Object...)
for use directly
by users in a debugger. This method guesses at the types of the method
based on the values of args
.public static java.lang.Object callEx(java.lang.Class klass, java.lang.Object obj, java.lang.String methodName, java.lang.Class[] types, java.lang.Object... args) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
klass
- Either a class of type JavaScriptObject or an interface
implemented by a JavaScriptObject. The class must contain the method to
be invoked.obj
- The JavaScriptObject to invoke the method on. Must be null if
the method is static. Must be not-null if the method is not staticmethodName
- The name of the methodtypes
- The types of the argumentsargs
- The values of the argumentsjava.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public static java.lang.Object callEx(java.lang.Class klass, java.lang.Object obj, java.lang.String methodName, java.lang.Object... args) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
call(Class, Object, String, Class[], Object...)
for use directly
by users in a debugger. This method guesses at the types of the method
based on the values of args
.java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
public static java.lang.Object callStatic(java.lang.Class klass, java.lang.String methodName, java.lang.Class[] types, java.lang.Object... args)
call(klass, null, methodName, types, args)
public static java.lang.Object callStaticEx(java.lang.Class klass, java.lang.String methodName, java.lang.Class[] types, java.lang.Object... args) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
call(klass, null, methodName, types, args)
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException