public abstract class BaseJavetConverter extends java.lang.Object implements IJavetConverter
Modifier and Type | Field and Description |
---|---|
protected JavetConverterConfig<?> |
config
The Config.
|
Constructor and Description |
---|
BaseJavetConverter()
Instantiates a new Base javet converter.
|
Modifier and Type | Method and Description |
---|---|
JavetConverterConfig<?> |
getConfig()
Gets config.
|
void |
setConfig(JavetConverterConfig<?> config)
Sets config.
|
<T> T |
toObject(V8Value v8Value)
To object from V8 value.
|
protected abstract <T> T |
toObject(V8Value v8Value,
int depth)
To object with stack depth.
|
<T extends V8Value> |
toV8Value(V8Runtime v8Runtime,
java.lang.Object object)
To V8 value from object.
|
protected abstract <T extends V8Value> |
toV8Value(V8Runtime v8Runtime,
java.lang.Object object,
int depth)
To V8 value with stack depth.
|
protected void |
validateDepth(int depth)
Validate the stack depth.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toObject
protected JavetConverterConfig<?> config
public BaseJavetConverter()
public JavetConverterConfig<?> getConfig()
IJavetConverter
getConfig
in interface IJavetConverter
public void setConfig(JavetConverterConfig<?> config)
config
- the configpublic final <T> T toObject(V8Value v8Value) throws JavetException
IJavetConverter
Don't override this function, instead, override the one with depth as argument for circular structure detection.
toObject
in interface IJavetConverter
T
- the type parameterv8Value
- the V8 valueJavetException
- the javet exceptionprotected abstract <T> T toObject(V8Value v8Value, int depth) throws JavetException
T
- the type parameterv8Value
- the V8 valuedepth
- the stack depthJavetException
- the javet exception@CheckReturnValue public final <T extends V8Value> T toV8Value(V8Runtime v8Runtime, java.lang.Object object) throws JavetException
IJavetConverter
Don't override this function, instead, override the one with depth as argument for circular structure detection.
toV8Value
in interface IJavetConverter
T
- the type parameterv8Runtime
- the V8 runtimeobject
- the objectJavetException
- the javet exception@CheckReturnValue protected abstract <T extends V8Value> T toV8Value(V8Runtime v8Runtime, java.lang.Object object, int depth) throws JavetException
T
- the type parameterv8Runtime
- the V8 runtimeobject
- the objectdepth
- the stack depthJavetException
- the javet exceptionprotected void validateDepth(int depth) throws JavetException
depth
- the stack depthJavetException
- the javet exception