Package io.roastedroot.quickjs4j.core
Class Engine
- java.lang.Object
-
- io.roastedroot.quickjs4j.core.Engine
-
- All Implemented Interfaces:
AutoCloseable
public final class Engine extends Object implements AutoCloseable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEngine.Builder
-
Field Summary
Fields Modifier and Type Field Description static com.fasterxml.jackson.databind.ObjectMapperDEFAULT_OBJECT_MAPPER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Engine.Builderbuilder()voidclose()intcompile(byte[] js)intcompile(String js)intcompileRaw(byte[] js)voidexec(int codePtr)voidfree(int codePtr)ObjectinvokeGuestFunction(String moduleName, String name, List<Object> args, String libraryCode)byte[]readCompiled(int codePtr)Stringstderr()Stringstdout()intwriteCompiled(byte[] jsBytecode)
-
-
-
Method Detail
-
builder
public static Engine.Builder builder()
-
invokeGuestFunction
public Object invokeGuestFunction(String moduleName, String name, List<Object> args, String libraryCode)
-
compile
public int compile(String js)
-
compile
public int compile(byte[] js)
-
compileRaw
public int compileRaw(byte[] js)
-
exec
public void exec(int codePtr)
-
stdout
public String stdout()
-
stderr
public String stderr()
-
free
public void free(int codePtr)
-
readCompiled
public byte[] readCompiled(int codePtr)
-
writeCompiled
public int writeCompiled(byte[] jsBytecode)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-