Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Package Functions | Private Member Functions | Static Private Member Functions | Private Attributes
netscape.javascript.JSObject Class Reference

JSObject allows Java to manipulate objects that are defined in JavaScript. More...

List of all members.

Public Member Functions

native Object getMember (String name)
 Retrieves a named member of a JavaScript object.
native Object getSlot (int index)
 Retrieves an indexed member of a JavaScript object.
native void setMember (String name, Object value)
 Sets a named member of a JavaScript object.
native void setSlot (int index, Object value)
 Sets an indexed member of a JavaScript object.
native void removeMember (String name)
 Removes a named member of a JavaScript object.
native Object call (String methodName, Object args[])
 Calls a JavaScript method.
native Object eval (String s)
 Evaluates a JavaScript expression.
native String toString ()
 Converts a JSObject to a String.
native boolean equals (Object obj)
 Override java.lang.Object.equals() because identity is not preserved with instances of JSObject.

Static Public Member Functions

static native JSObject getWindow (Applet applet)
 get a JSObject for the window containing the given applet

Protected Member Functions

native void finalize ()
 Finalization decrements the reference count on the corresponding JavaScript object.

Static Package Functions

 [static initializer]

Private Member Functions

 JSObject (int jsobj_addr)
 it is illegal to construct a JSObject manually
 JSObject (long jsobj_addr)

Static Private Member Functions

static native void initClass ()
 initialize

Private Attributes

int long long_internal

Detailed Description

JSObject allows Java to manipulate objects that are defined in JavaScript.

Values passed from Java to JavaScript are converted as follows:

Values passed from JavaScript to Java are converted as follows:

This means that all JavaScript values show up as some kind of java.lang.Object in Java. In order to make much use of them, you will have to cast them to the appropriate subclass of Object, e.g. (String) window.getMember("name"); or (JSObject) window.getMember("document");.

Definition at line 82 of file JSObject.java.


Constructor & Destructor Documentation

netscape.javascript.JSObject.JSObject ( int  jsobj_addr) [inline, private]

it is illegal to construct a JSObject manually

Definition at line 103 of file JSObject.java.

                                     {
        internal = jsobj_addr;
    }
netscape.javascript.JSObject.JSObject ( long  jsobj_addr) [inline, private]

Definition at line 107 of file JSObject.java.

                                      {
        long_internal = jsobj_addr;
    }

Member Function Documentation

netscape.javascript.JSObject.[static initializer] ( ) [inline, static, package]
native Object netscape.javascript.JSObject.call ( String  methodName,
Object  args[] 
)

Calls a JavaScript method.

Equivalent to "this.<i>methodName</i>(<i>args</i>[0], <i>args</i>[1], ...)" in JavaScript.

Here is the caller graph for this function:

Override java.lang.Object.equals() because identity is not preserved with instances of JSObject.

Evaluates a JavaScript expression.

The expression is a string of JavaScript source code which will be evaluated in the context given by "this".

Here is the caller graph for this function:

Finalization decrements the reference count on the corresponding JavaScript object.

Retrieves a named member of a JavaScript object.

Equivalent to "this.<i>name</i>" in JavaScript.

Retrieves an indexed member of a JavaScript object.

Equivalent to "this[<i>index</i>]" in JavaScript.

static native JSObject netscape.javascript.JSObject.getWindow ( Applet  applet) [static]

get a JSObject for the window containing the given applet

Here is the caller graph for this function:

static native void netscape.javascript.JSObject.initClass ( ) [static, private]

initialize

Removes a named member of a JavaScript object.

Sets a named member of a JavaScript object.

Equivalent to "this.<i>name</i> = <i>value</i>" in JavaScript.

native void netscape.javascript.JSObject.setSlot ( int  index,
Object  value 
)

Sets an indexed member of a JavaScript object.

Equivalent to "this[<i>index</i>] = <i>value</i>" in JavaScript.

Converts a JSObject to a String.


Member Data Documentation

Definition at line 84 of file JSObject.java.


The documentation for this class was generated from the following file: