public final class V8ValueUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static int |
asInt(V8Value[] v8Values,
int index)
Call asInt() by V8 value array and index.
|
static int |
asInt(V8Value[] v8Values,
int index,
int defaultValue)
Call asInt() by V8 value array and index.
|
static java.lang.String |
asString(V8Value v8Value)
Call toString() by V8 value.
|
static java.lang.String |
asString(V8Value[] v8Values,
int index)
Call toString() by V8 value array and index.
|
static java.lang.String |
asString(V8Value[] v8Values,
int index,
java.lang.String defaultValue)
Call toString() by V8 value array and index.
|
static java.lang.String |
asString(V8Value v8Value,
java.lang.String defaultValue)
Call toString() by V8 value.
|
static V8Value |
asV8Value(V8Value[] v8Values,
int index)
As V8Value by V8 value array and index.
|
static V8ValueFunction |
asV8ValueFunction(V8Value[] v8Values,
int index)
Get V8ValueFunction by V8 value array and index.
|
static V8ValueFunction |
asV8ValueFunctionWithError(V8Runtime v8Runtime,
V8Value[] v8Values,
int index)
Get V8ValueFunction by V8 value array and index.
|
static V8ValueObject |
asV8ValueObject(V8Value[] v8Values,
int index)
As V8ValueObject by V8 value array and index.
|
static java.lang.String |
concat(java.lang.String delimiter,
V8Value... v8Values)
Concat string.
|
static JavetVirtualObject[] |
convertToVirtualObjects(V8Value... v8Values)
Convert to virtual objects.
|
static V8ValueArray |
createV8ValueArray(V8Runtime v8Runtime,
java.lang.Object... objects)
Create V8 value array from object array.
|
static V8ValueMap |
createV8ValueMap(V8Runtime v8Runtime,
java.util.Map<?,?> map)
Create V8 value map from map.
|
static V8ValueObject |
createV8ValueObject(V8Runtime v8Runtime,
java.lang.Object... objects)
Create V8 value object from object array.
|
static V8ValueSet |
createV8ValueSet(V8Runtime v8Runtime,
java.lang.Object... objects)
Create V8 value set from object array.
|
static java.lang.Object[] |
toArray(V8Runtime v8Runtime,
V8Value... v8Values)
Convert V8 values to objects.
|
static java.lang.String |
trimAnonymousFunction(java.lang.String sourceCode)
Trim anonymous function source code.
|
public static int asInt(V8Value[] v8Values, int index) throws JavetException
v8Values
- the V8 valuesindex
- the indexJavetException
- the javet exceptionpublic static int asInt(V8Value[] v8Values, int index, int defaultValue) throws JavetException
v8Values
- the V8 valuesindex
- the indexdefaultValue
- the default valueJavetException
- the javet exceptionpublic static java.lang.String asString(V8Value[] v8Values, int index)
v8Values
- the V8 valuesindex
- the indexpublic static java.lang.String asString(V8Value[] v8Values, int index, java.lang.String defaultValue)
v8Values
- the V8 valuesindex
- the indexdefaultValue
- the default valuepublic static java.lang.String asString(V8Value v8Value)
v8Value
- the V8 valuepublic static java.lang.String asString(V8Value v8Value, java.lang.String defaultValue)
v8Value
- the V8 valuedefaultValue
- the default value@CheckReturnValue public static V8Value asV8Value(V8Value[] v8Values, int index)
v8Values
- the V8 valuesindex
- the index@CheckReturnValue public static V8ValueFunction asV8ValueFunction(V8Value[] v8Values, int index)
v8Values
- the V8 valuesindex
- the index@CheckReturnValue public static V8ValueFunction asV8ValueFunctionWithError(V8Runtime v8Runtime, V8Value[] v8Values, int index)
v8Runtime
- the V8 runtimev8Values
- the V8 valuesindex
- the index@CheckReturnValue public static V8ValueObject asV8ValueObject(V8Value[] v8Values, int index)
v8Values
- the V8 valuesindex
- the indexpublic static java.lang.String concat(java.lang.String delimiter, V8Value... v8Values)
delimiter
- the delimiterv8Values
- the V8 valuespublic static JavetVirtualObject[] convertToVirtualObjects(V8Value... v8Values)
v8Values
- the V8 values@CheckReturnValue public static V8ValueArray createV8ValueArray(V8Runtime v8Runtime, java.lang.Object... objects) throws JavetException
v8Runtime
- the V8 runtimeobjects
- the objectsJavetException
- the javet exception@CheckReturnValue public static V8ValueMap createV8ValueMap(V8Runtime v8Runtime, java.util.Map<?,?> map) throws JavetException
v8Runtime
- the V8 runtimemap
- the mapJavetException
- the javet exception@CheckReturnValue public static V8ValueObject createV8ValueObject(V8Runtime v8Runtime, java.lang.Object... objects) throws JavetException
v8Runtime
- the V8 runtimeobjects
- the objectsJavetException
- the javet exception@CheckReturnValue public static V8ValueSet createV8ValueSet(V8Runtime v8Runtime, java.lang.Object... objects) throws JavetException
v8Runtime
- the V8 runtimeobjects
- the objectsJavetException
- the javet exceptionpublic static java.lang.Object[] toArray(V8Runtime v8Runtime, V8Value... v8Values) throws JavetException
v8Runtime
- the V8 runtimev8Values
- the V8 valuesJavetException
- the javet exceptionpublic static java.lang.String trimAnonymousFunction(java.lang.String sourceCode)
sourceCode
- the source code