public class V8ObjectUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Object |
getTypedArray(V8Array array,
int arrayType)
Creates a Java array from a V8Array.
|
static Object |
getTypedArray(V8Array array,
int arrayType,
Object result)
Populates a Java array from a V8Array.
|
static Object |
getV8Result(V8 v8,
Object value)
Returns an object usable with a V8 Runtime which represents
the parameter 'value'.
|
static Object |
getValue(V8Array array,
int index)
Gets a Java Object representing the value at the given index in the V8Array.
|
static Object |
getValue(V8Object object,
String key)
Gets a Java Object representing the value with the given key in the V8Object.
|
static void |
pushValue(V8 v8,
V8Array array,
Object value)
Pushes a Java Object to a V8Array by first converting it to a V8Value if needed.
|
static List<? super Object> |
toList(V8Array array)
Creates a List
|
static Map<String,? super Object> |
toMap(V8Object object)
Creates a Map
|
static V8Array |
toV8Array(V8 v8,
List<? extends Object> list)
Creates a V8Array from a java.util.List.
|
static V8Object |
toV8Object(V8 v8,
Map<String,? extends Object> map)
Creates a V8Object from a java.util.Map.
|
public static Map<String,? super Object> toMap(V8Object object)
object - The root of the V8Object graph.public static List<? super Object> toList(V8Array array)
array - The root of the V8Array graph.public static Object getTypedArray(V8Array array, int arrayType, Object result)
array - The V8Array to convert to a Java Array.arrayType - The type of the V8Array to convert.result - The array to use as the result. If null, a new array will be created.public static Object getTypedArray(V8Array array, int arrayType)
array - The V8Array to convert to a Java Array.arrayType - The type of the V8Array to convert.public static V8Object toV8Object(V8 v8, Map<String,? extends Object> map)
v8 - The runtime on which to create the result.map - The map to convert to a V8Object.public static V8Array toV8Array(V8 v8, List<? extends Object> list)
v8 - The runtime on which to create the result.list - The list to convert to a V8Array.public static Object getV8Result(V8 v8, Object value)
v8 - The runtime on which to create V8Values.value - The value to convert to an object usable with V8public static void pushValue(V8 v8, V8Array array, Object value)
v8 - The runtime on which to create any needed V8Values.array - The array to push the elements to.value - The value to push to the array.public static Object getValue(V8Array array, int index)
array - The array on which to lookup the value. The array is not
released.index - The index whose element to lookup.public static Object getValue(V8Object object, String key)
object - The object on which to lookup the value. The object is not
released.key - The key to use to lookup the value.Copyright © 2015. All rights reserved.