public class JSObject extends Object
| Constructor and Description |
|---|
JSObject(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject scriptableObject)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
call(String methodName,
Object[] args)
Calls a JavaScript method.
|
Object |
eval(String expression)
Evaluates a JavaScript expression.
|
Object |
getMember(String name)
Retrieves a named member of a JavaScript object.
|
Object |
getSlot(int index)
Retrieves an indexed member of a JavaScript object.
|
static JSObject |
getWindow(Applet paramApplet)
Returns a JSObject for the window containing the given applet.
|
void |
removeMember(String name)
Removes a named member of a JavaScript object.
|
void |
setMember(String name,
Object value)
Sets a named member of a JavaScript object.
|
void |
setSlot(int index,
Object value)
Sets an indexed member of a JavaScript object.
|
static void |
setWindow(Window window)
Sets the window this class works for.
|
public JSObject(net.sourceforge.htmlunit.corejs.javascript.ScriptableObject scriptableObject)
scriptableObject - the wrapped scriptableObjectpublic Object call(String methodName, Object[] args) throws JSException
methodName - the name of the JavaScript method to be invokedargs - an array of Java object to be passed as arguments to the methodJSException - in case or errorpublic Object eval(String expression) throws JSException
expression - the JavaScript expressionJSException - in case or errorpublic Object getMember(String name) throws JSException
name - the name of the JavaScript property to be accessedJSException - in case or errorpublic void setMember(String name, Object value) throws JSException
name - the name of the JavaScript property to be accessedvalue - the value of the propertyJSException - in case or errorpublic void removeMember(String name) throws JSException
name - the name of the JavaScript property to be accessedJSException - in case or errorpublic Object getSlot(int index) throws JSException
index - the index of the array to be accessedJSException - in case or errorpublic void setSlot(int index,
Object value)
throws JSException
index - the index of the array to be accessedvalue - the value of the propertyJSException - in case or errorpublic static JSObject getWindow(Applet paramApplet) throws JSException
paramApplet - the paramAppletJSException - in case or errorpublic static void setWindow(Window window)
window - the windowCopyright © 2002–2017 Gargoyle Software Inc.. All rights reserved.