Luaj / Java:我们如何将数据返回到Java?

时间:2015-01-22 01:58:09

标签: java lua luaj

我正在学习Lua和Java的LuaJ库。我看到了如何创建和运行脚本:

String script = "message = 'Hello World!'";
InputStream input = new ByteArrayInputStream(script.getBytes());
Prototype prototype = LuaC.compile(input, "script");
LuaValue globals = JsePlatform.standardGlobals();
LuaClosure closure = new LuaClosure(prototype, globals); 
LuaValue value = closure.call();

如何将Lua变量message的值返回给Java并通过LuaValue访问它?这可能吗?

0 个答案:

没有答案