public class JsValueOOPHM extends JsValue
JsValue.DispatchMethod, JsValue.DispatchObject
Constructor and Description |
---|
JsValueOOPHM()
Create a JsValueMoz object representing the undefined value.
|
JsValueOOPHM(int jsRefId)
Create a JsValueOOPHM object wrapping a JS object given the object
reference id.
|
JsValueOOPHM(JsValueOOPHM other)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean()
Get the value of the object as a boolean.
|
int |
getInt()
Get the value of the object as an integer.
|
JsValue.DispatchObject |
getJavaObjectWrapper()
Get the wrapper object for a wrapped Java object.
|
BrowserChannel.JsObjectRef |
getJavascriptObject() |
int |
getJavaScriptObjectPointer()
Returns a unique value corresponding to the underlying JavaScript object.
|
double |
getNumber()
Get the value of the object as a double.
|
String |
getString()
Get the value of the object as a string.
|
String |
getTypeString()
Returns a human-readable string describing the type of the JS object.
|
JsValue.DispatchMethod |
getWrappedJavaFunction()
Returns a wrapped Java method.
|
Object |
getWrappedJavaObject()
Unwrap a wrapped Java object.
|
boolean |
isBoolean()
Returns true if the JS value is a boolean.
|
boolean |
isInt()
Returns true if getInt() can be used on this value.
|
boolean |
isJavaScriptObject()
Returns true if the JS value is a native JS object.
|
boolean |
isNull()
Returns true if the JS value is null.
|
boolean |
isNumber()
Returns true if the JS value is a numeric type.
|
boolean |
isString()
Returns true if the JS value is a string.
|
boolean |
isUndefined()
Returns true if the JS value is undefined (void).
|
boolean |
isWrappedJavaFunction()
Returns true if the JS value contains a wrapped Java method.
|
boolean |
isWrappedJavaObject()
Returns true if the JS value is a wrapped Java object.
|
void |
setBoolean(boolean val)
Sets the JS object to be a boolean value.
|
void |
setByte(byte val)
Sets the JS object to be a number, passed as an byte.
|
void |
setChar(char val)
Sets the JS object to be a number, passed as a char.
|
void |
setDouble(double val)
Sets the JS object to be a number, passed as a double.
|
void |
setInt(int val)
Sets the JS object to be a number, passed as an int.
|
void |
setJavascriptObject(BrowserChannel.JsObjectRef jsObject) |
void |
setNull()
Set the JS object to be null.
|
void |
setShort(short val)
Sets the JS object to be a number, passed as a short.
|
void |
setString(String val)
Set the JS object to the supplied string.
|
void |
setUndefined()
Set the JS object to be undefined (void).
|
void |
setValue(JsValue other)
Make this JsValue refer to the same underlying object as another JsValue.
|
void |
setWrappedFunction(String methodName,
JsValue.DispatchMethod dispatchMethod)
Wrap a function call to a Java method in this JavaScript value.
|
<T> void |
setWrappedJavaObject(CompilingClassLoader cl,
T val)
Set the JS object to the supplied object, which will be wrapped in a
platform-dependent JavaScript class.
|
public static final String JSE_CLASS
public JsValueOOPHM()
public JsValueOOPHM(int jsRefId)
jsRefId
- pointer to underlying JsRootedValue as an integer.public JsValueOOPHM(JsValueOOPHM other)
other
- JsValueMoz instance to copypublic boolean getBoolean()
JsValue
getBoolean
in class JsValue
public int getInt()
JsValue
public JsValue.DispatchObject getJavaObjectWrapper()
JsValue
getJavaObjectWrapper
in class JsValue
public BrowserChannel.JsObjectRef getJavascriptObject()
public int getJavaScriptObjectPointer()
JsValue
getJavaScriptObjectPointer
in class JsValue
0
if JsValue.isJavaScriptObject()
is
false
public double getNumber()
JsValue
public String getString()
JsValue
JsValue.isString()
is true
.public String getTypeString()
JsValue
getTypeString
in class JsValue
public JsValue.DispatchMethod getWrappedJavaFunction()
JsValue
getWrappedJavaFunction
in class JsValue
public Object getWrappedJavaObject()
JsValue
getWrappedJavaObject
in class JsValue
public boolean isBoolean()
JsValue
public boolean isInt()
JsValue
public boolean isJavaScriptObject()
JsValue
isJavaScriptObject
in class JsValue
public boolean isNull()
JsValue
public boolean isNumber()
JsValue
public boolean isString()
JsValue
public boolean isUndefined()
JsValue
isUndefined
in class JsValue
public boolean isWrappedJavaFunction()
JsValue
isWrappedJavaFunction
in class JsValue
public boolean isWrappedJavaObject()
JsValue
isWrappedJavaObject
in class JsValue
public void setBoolean(boolean val)
JsValue
setBoolean
in class JsValue
val
- the boolean value to setpublic void setByte(byte val)
JsValue
public void setChar(char val)
JsValue
public void setDouble(double val)
JsValue
public void setInt(int val)
JsValue
public void setJavascriptObject(BrowserChannel.JsObjectRef jsObject)
public void setNull()
JsValue
public void setShort(short val)
JsValue
public void setString(String val)
JsValue
public void setUndefined()
JsValue
setUndefined
in class JsValue
public void setValue(JsValue other)
JsValue
public void setWrappedFunction(String methodName, JsValue.DispatchMethod dispatchMethod)
methodName
- the name of the method to invokedispatchMethod
- the wrapper objectpublic <T> void setWrappedJavaObject(CompilingClassLoader cl, T val)
JsValue
setWrappedJavaObject
in class JsValue
T
- the type of the Java object to wrapcl
- the classloader to create the wrapper object withval
- the Java object to wrapCopyright © 2018. All rights reserved.