public class V8Module extends V8ValueReference implements IV8Module
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
resourceName
The Resource name.
|
protected java.lang.Boolean |
sourceTextModule
The source text module is an internal cache storing whether the module is source text or not.
|
protected java.lang.Boolean |
syntheticModule
The synthetic module is an internal cache storing whether the module is synthetic or not.
|
handle, INVALID_HANDLE, weak
OBJECT_CONVERTER, v8Runtime
Errored, Evaluated, Evaluating, Instantiated, Instantiating, Uninstantiated
Modifier and Type | Method and Description |
---|---|
<T extends V8Value> |
evaluate(boolean resultRequired)
Evaluate the module.
|
byte[] |
getCachedData()
Gets cached data.
|
V8ValueError |
getException()
Gets exception.
|
int |
getIdentityHash()
Returns the identity hash for this object.
|
V8Value |
getNamespace()
Gets namespace.
|
java.lang.String |
getResourceName()
Gets resource name.
|
int |
getScriptId()
Gets script id.
|
int |
getStatus()
Gets status.
|
V8ValueReferenceType |
getType() |
boolean |
instantiate()
Instantiate.
|
boolean |
isSourceTextModule()
Is source text module.
|
boolean |
isSyntheticModule()
Is synthetic module.
|
V8Module |
toClone(boolean referenceCopy)
Get a clone of the current V8 value.
|
java.lang.String |
toString() |
addReference, checkV8Runtime, clearWeak, close, close, equals, getHandle, isClosed, isWeak, isWeak, removeReference, sameValue, setWeak, strictEquals
getV8Runtime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
evaluate, execute, toObject, toV8Value
clearWeak, close, getHandle, isClosed, isWeak, isWeak, setWeak
asBoolean, asDouble, asInt, asLong, asString, equals, getV8Runtime, isNull, isNullOrUndefined, isUndefined, sameValue, strictEquals
close
toClone
execute, executeBigInteger, executeBoolean, executeDouble, executeInteger, executeLong, executeObject, executeString, executeVoid, executeZonedDateTime
toObject
protected java.lang.String resourceName
protected java.lang.Boolean sourceTextModule
protected java.lang.Boolean syntheticModule
@CheckReturnValue public <T extends V8Value> T evaluate(boolean resultRequired) throws JavetException
IV8Module
evaluate
in interface IV8Module
T
- the type parameterresultRequired
- the result requiredJavetException
- the javet exceptionpublic byte[] getCachedData() throws JavetException
IV8Cacheable
getCachedData
in interface IV8Cacheable
JavetException
- the javet exception@CheckReturnValue public V8ValueError getException() throws JavetException
IV8Module
getException
in interface IV8Module
JavetException
- the javet exceptionpublic int getIdentityHash() throws JavetException
IV8Module
The return value will never be 0. Also, it is not guaranteed to be unique.
getIdentityHash
in interface IV8Module
JavetException
- the javet exception@CheckReturnValue public V8Value getNamespace() throws JavetException
IV8Module
The module's status must be at least kInstantiated. Otherwise, undefined is returned.
getNamespace
in interface IV8Module
JavetException
- the javet exceptionpublic java.lang.String getResourceName() throws JavetException
IV8Module
getResourceName
in interface IV8Module
JavetException
- the javet exceptionpublic int getScriptId() throws JavetException
IV8Module
The module must be a SourceTextModule and must not have a kErrored status. Otherwise, -1 is returned.
getScriptId
in interface IV8Module
JavetException
- the javet exceptionpublic int getStatus() throws JavetException
IV8Module
getStatus
in interface IV8Module
JavetException
- the javet exceptionpublic V8ValueReferenceType getType()
getType
in interface IV8ValueReference
getType
in class V8ValueReference
public boolean instantiate() throws JavetException
IV8Module
instantiate
in interface IV8Module
JavetException
- the javet exceptionpublic boolean isSourceTextModule() throws JavetException
IV8Module
isSourceTextModule
in interface IV8Module
JavetException
- the javet exceptionpublic boolean isSyntheticModule() throws JavetException
IV8Module
isSyntheticModule
in interface IV8Module
JavetException
- the javet exception@CheckReturnValue public V8Module toClone(boolean referenceCopy) throws JavetException
IV8Cloneable
toClone
in interface IV8Cloneable
toClone
in class V8ValueReference
referenceCopy
- the reference copyJavetException
- the javet exceptionpublic java.lang.String toString()
toString
in class V8ValueReference