|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.core.client.JavaScriptObject org.gwtopenmaps.openlayers.client.util.JSObject
public class JSObject
A JSObject is an opaque handle to a JavaScript object. Like it's parent it cannot be created directly. A JSObject has to be created via JSNI or via the static factory method createJSObject. It expands upon it's parent by offering several convenience functions, such as setter and getter methods to set properties on the JSObject. A property can be a number, boolean or string, but also another JSObject or a DOM Element. To set a function on a JSObject, it can be created via JSNI, returned as a JSObject and set as property.
The purpose of the setter and getter methods is to reduce the amount of JSNI code necessary for working with JavaScript objects.
Constructor Summary | |
---|---|
protected |
JSObject()
|
Method Summary | |
---|---|
static JSObject |
createJSArray()
|
static JSObject |
createJSFunction()
|
static JSObject |
createJSObject()
|
JSObject |
ensureOpaqueArray()
Checks whether the JSObject is a JavaScript Array by duck typing. |
JSObject |
getProperty(String name)
|
JSObject[] |
getPropertyAsArray(String name)
Takes a property name of a JSObject that is a javascript array. |
boolean |
getPropertyAsBoolean(String name)
|
com.google.gwt.user.client.Element |
getPropertyAsDomElement(String name)
|
double |
getPropertyAsDouble(String name)
|
float |
getPropertyAsFloat(String name)
|
int |
getPropertyAsInt(String name)
|
String |
getPropertyAsString(String name)
|
String |
getPropertyNames()
Let's you inspect the names of properties of a javascript object. |
boolean |
hasProperty(String name)
|
void |
setProperty(String name,
boolean value)
|
void |
setProperty(String name,
double value)
|
void |
setProperty(String name,
com.google.gwt.user.client.Element value)
|
void |
setProperty(String name,
float value)
|
void |
setProperty(String name,
int value)
|
void |
setProperty(String name,
JSObject value)
|
void |
setProperty(String name,
String value)
|
void |
unsetProperty(String name)
Unset/Clear the property with the given name. |
Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
---|
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected JSObject()
Method Detail |
---|
public static JSObject createJSObject()
public static JSObject createJSFunction()
public static JSObject createJSArray()
public final void setProperty(String name, int value)
public final int getPropertyAsInt(String name)
public final void setProperty(String name, String value)
public final String getPropertyAsString(String name)
public final void setProperty(String name, boolean value)
public final boolean getPropertyAsBoolean(String name)
public final void setProperty(String name, float value)
public final float getPropertyAsFloat(String name)
public final void setProperty(String name, double value)
public final double getPropertyAsDouble(String name)
public final void setProperty(String name, com.google.gwt.user.client.Element value)
public final com.google.gwt.user.client.Element getPropertyAsDomElement(String name)
public final void setProperty(String name, JSObject value)
public final JSObject getProperty(String name)
public final String getPropertyNames()
public final boolean hasProperty(String name)
public final void unsetProperty(String name)
object
- The object in which the property existsname
- The name of the propertypublic final JSObject ensureOpaqueArray()
public final JSObject[] getPropertyAsArray(String name)
name
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |