public class V8Object extends V8Value
| Modifier | Constructor and Description |
|---|---|
protected |
V8Object() |
|
V8Object(V8 v8)
Create a new V8Object and associate it with a runtime.
|
| Modifier and Type | Method and Description |
|---|---|
V8Object |
add(String key,
boolean value)
Adds a key value pair to the receiver where the value is a boolean.
|
V8Object |
add(String key,
double value)
Adds a key value pair to the receiver where the value is a double.
|
V8Object |
add(String key,
int value)
Adds a key value pair to the receiver where the value is an integer.
|
V8Object |
add(String key,
String value)
Adds a key value pair to the receiver where the value is a String.
|
V8Object |
add(String key,
V8Value value)
Adds a key value pair to the receiver where the value is a V8Value.
|
V8Object |
addNull(String key)
Associate NULL with the given key.
|
V8Object |
addUndefined(String key)
Associate UNDEFINED with the given key.
|
boolean |
contains(String key)
Determine if a key/value pair with this key exists in
the Object.
|
protected V8Value |
createTwin() |
V8Array |
executeArrayFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a V8Array.
|
boolean |
executeBooleanFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a boolean.
|
double |
executeDoubleFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a double.
|
Object |
executeFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a Java Object.
|
int |
executeIntegerFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a integer.
|
V8Object |
executeObjectFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a V8Object.
|
String |
executeStringFunction(String name,
V8Array parameters)
Invoke a JavaScript function and return the result as a String.
|
void |
executeVoidFunction(String name,
V8Array parameters)
Invokes a JavaScript function which does not return a result.
|
Object |
get(String key)
Returns the value associated with this key.
|
V8Array |
getArray(String key)
Returns the V8Array value associated with this key.
|
boolean |
getBoolean(String key)
Returns the boolean value associated with this key.
|
double |
getDouble(String key)
Returns the double value associated with this key.
|
int |
getInteger(String key)
Returns the integer value associated with this key.
|
String[] |
getKeys()
Returns all the keys associated with this JavaScript Object.
|
V8Object |
getObject(String key)
Returns the V8Object value associated with this key.
|
String |
getString(String key)
Returns the String value associated with this key.
|
int |
getType(String key)
Returns the type of the value associated with this Key, or
UNDEFINED if the key does not exist.
|
V8Object |
registerJavaMethod(JavaCallback callback,
String jsFunctionName)
Register a Java method as a JavaScript function.
|
V8Object |
registerJavaMethod(JavaVoidCallback callback,
String jsFunctionName)
Register a void Java method as a JavaScript function.
|
V8Object |
registerJavaMethod(Object object,
String methodName,
String jsFunctionName,
Class<?>[] parameterTypes)
Register a Java method reflectively given it's name a signature.
|
V8Object |
registerJavaMethod(Object object,
String methodName,
String jsFunctionName,
Class<?>[] parameterTypes,
boolean includeReceiver)
Register a Java method reflectively given it's name a signature.
|
V8Object |
setPrototype(V8Object value)
Sets the prototype of the receiver.
|
String |
toString() |
V8Object |
twin()
Creates a new Java object pointing at the same V8 Value
as this.
|
checkReleaesd, equals, getHandle, getRuntime, getRutime, hashCode, initialize, isReleased, isUndefined, jsEquals, release, strictEqualspublic V8Object(V8 v8)
v8 - The runtime on which to associate the V8Object.protected V8Object()
protected V8Value createTwin()
createTwin in class V8Valuepublic V8Object twin()
V8Valuepublic boolean contains(String key)
key - The key to checkpublic String[] getKeys()
public int getType(String key)
key - The key whose type to lookup.public Object get(String key)
key - The key whose value to return.public int getInteger(String key)
key - The key whose value to return.public boolean getBoolean(String key)
key - The key whose value to return.public double getDouble(String key)
key - The key whose value to return.public String getString(String key)
key - The key whose value to return.public V8Array getArray(String key)
key - The key whose value to return.public V8Object getObject(String key)
key - The key whose value to return.public int executeIntegerFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public double executeDoubleFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public String executeStringFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public boolean executeBooleanFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public V8Array executeArrayFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public V8Object executeObjectFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public Object executeFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public void executeVoidFunction(String name, V8Array parameters)
name - The name of the JS Function to call.parameters - The parameters to pass to the function. Parameters must be released.public V8Object add(String key, int value)
key - The key to associate the value with.value - The value to add.public V8Object add(String key, boolean value)
key - The key to associate the value with.value - The value to add.public V8Object add(String key, double value)
key - The key to associate the value with.value - The value to add.public V8Object add(String key, String value)
key - The key to associate the value with.value - The value to add.public V8Object add(String key, V8Value value)
key - The key to associate the value with.value - The value to add.public V8Object addUndefined(String key)
key - The key to associate UNDEFINED with.public V8Object addNull(String key)
key - The key to associate NULL with.public V8Object setPrototype(V8Object value)
value - The prototype to associate with this V8Object.public V8Object registerJavaMethod(JavaCallback callback, String jsFunctionName)
callback - The JavaCallback to call when the JSFunction is invoked.jsFunctionName - The name of the JSFunction.public V8Object registerJavaMethod(JavaVoidCallback callback, String jsFunctionName)
callback - The JavaVoidCallback to call when the JSFunction is invoked.jsFunctionName - The name of the JSFunction.public V8Object registerJavaMethod(Object object, String methodName, String jsFunctionName, Class<?>[] parameterTypes)
object - The Java Object on which the method is defined.methodName - The name of the method to register.jsFunctionName - The name of the JavaScript function to register the
method with.parameterTypes - The parameter types of the method.public V8Object registerJavaMethod(Object object, String methodName, String jsFunctionName, Class<?>[] parameterTypes, boolean includeReceiver)
object - The Java Object on which the method is defined.methodName - The name of the method to register.jsFunctionName - The name of the JavaScript function to register the
method with.parameterTypes - The parameter types of the method.includeReceiver - True if the first parameter should include the JS Object,
false otherwise.Copyright © 2015. All rights reserved.