Google Web Toolkit (Beta)
Search this site:

# Class JavaScriptObject

public class JavaScriptObject
extends Object
// Superclass of `Event`, `Element`
An opaque handle to a native JavaScript object. A `JavaScriptObject` cannot be created directly. `JavaScriptObject` should be declared as the return type of a JSNI method that returns native (non-Java) objects. A `JavaScriptObject` passed back into JSNI from Java becomes the original object, and can be accessed in JavaScript as expected.

SUBCLASSING IS NOT SUPPORTED EXCEPT FOR THE EXISTING SUBCLASSES.

## Fields

hostedModeReference | The underlying JavaScript object.

## Constructors

JavaScriptObject() | Not directly instantiable.

## Methods

equals(Object) |
hashCode() |
toString() |

## Field Detail

### hostedModeReference

protected Object hostedModeReference
The underlying JavaScript object. This is used internally and should never be accessed by client code.

## Constructor Detail

### JavaScriptObject

protected JavaScriptObject()
Not directly instantiable. Subclasses should also define a protected no-arg constructor to prevent client code from directly instantiating the class.

## Method Detail

### equals

public boolean equals(Object other)

#### Parameters

other

### hashCode

public int hashCode()

### toString

public String toString()