public class JsoEval extends 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 Object |
call(Class klass,
Object obj,
String methodName,
Class[] types,
Object... args)
Reflectively invokes a method on a JavaScriptObject.
|
static Object |
call(Class klass,
Object obj,
String methodName,
Object... args)
A convenience form of
call(Class, Object, String, Class[], Object...) for use directly
by users in a debugger. |
static Object |
callEx(Class klass,
Object obj,
String methodName,
Class[] types,
Object... args)
Reflectively invokes a method on a JavaScriptObject.
|
static Object |
callEx(Class klass,
Object obj,
String methodName,
Object... args)
A convenience form of
call(Class, Object, String, Class[], Object...) for use directly
by users in a debugger. |
static Object |
callStatic(Class klass,
String methodName,
Class[] types,
Object... args)
Reflectively invokes a static method on a JavaScriptObject.
|
static Object |
callStaticEx(Class klass,
String methodName,
Class[] types,
Object... args)
Reflectively invokes a static method on a JavaScriptObject.
|
public static Object call(Class klass, Object obj, String methodName, Class[] types, 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 Object call(Class klass, Object obj, String methodName, 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 Object callEx(Class klass, Object obj, String methodName, Class[] types, Object... args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, 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 argumentsClassNotFoundException
NoSuchMethodException
InvocationTargetException
IllegalAccessException
public static Object callEx(Class klass, Object obj, String methodName, Object... args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, 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
.public static Object callStatic(Class klass, String methodName, Class[] types, Object... args)
call(klass, null, methodName, types, args)
public static Object callStaticEx(Class klass, String methodName, Class[] types, Object... args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException
call(klass, null, methodName, types, args)
Copyright © 2018. All rights reserved.