Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

netscape.javascript
Class JSObject  view JSObject download JSObject.java

java.lang.Object
  extended bynetscape.javascript.JSObject

public final class JSObject
extends java.lang.Object

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");.


Field Summary
private  int internal
           
private  long long_internal
           
 
Constructor Summary
private JSObject(int jsobj_addr)
          it is illegal to construct a JSObject manually
private JSObject(long jsobj_addr)
           
 
Method Summary
 java.lang.Object call(java.lang.String methodName, java.lang.Object[] args)
          Calls a JavaScript method.
 boolean equals(java.lang.Object obj)
          Override java.lang.Object.equals() because identity is not preserved with instances of JSObject.
 java.lang.Object eval(java.lang.String s)
          Evaluates a JavaScript expression.
protected  void finalize()
          Finalization decrements the reference count on the corresponding JavaScript object.
 java.lang.Object getMember(java.lang.String name)
          Retrieves a named member of a JavaScript object.
 java.lang.Object getSlot(int index)
          Retrieves an indexed member of a JavaScript object.
static JSObject getWindow(java.applet.Applet applet)
          get a JSObject for the window containing the given applet
private static void initClass()
          initialize
 void removeMember(java.lang.String name)
          Removes a named member of a JavaScript object.
 void setMember(java.lang.String name, java.lang.Object value)
          Sets a named member of a JavaScript object.
 void setSlot(int index, java.lang.Object value)
          Sets an indexed member of a JavaScript object.
 java.lang.String toString()
          Converts a JSObject to a String.
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

internal

private int internal

long_internal

private long long_internal
Constructor Detail

JSObject

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


JSObject

private JSObject(long jsobj_addr)
Method Detail

initClass

private static void initClass()
initialize


getMember

public java.lang.Object getMember(java.lang.String name)
Retrieves a named member of a JavaScript object. Equivalent to "this.name" in JavaScript.


getSlot

public java.lang.Object getSlot(int index)
Retrieves an indexed member of a JavaScript object. Equivalent to "this[index]" in JavaScript.


setMember

public void setMember(java.lang.String name,
                      java.lang.Object value)
Sets a named member of a JavaScript object. Equivalent to "this.name = value" in JavaScript.


setSlot

public void setSlot(int index,
                    java.lang.Object value)
Sets an indexed member of a JavaScript object. Equivalent to "this[index] = value" in JavaScript.


removeMember

public void removeMember(java.lang.String name)
Removes a named member of a JavaScript object.


call

public java.lang.Object call(java.lang.String methodName,
                             java.lang.Object[] args)
Calls a JavaScript method. Equivalent to "this.methodName(args[0], args[1], ...)" in JavaScript.


eval

public java.lang.Object eval(java.lang.String s)
Evaluates a JavaScript expression. The expression is a string of JavaScript source code which will be evaluated in the context given by "this".


toString

public java.lang.String toString()
Converts a JSObject to a String.


getWindow

public static JSObject getWindow(java.applet.Applet applet)
get a JSObject for the window containing the given applet


finalize

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


equals

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