LuaInterface: Scripting the .NET CLR with Lua
LuaJava is a scripting tool for Java. It allows Lua scripts to use Java objects andcreate classes from Lua tablesOn the consumer side, LuaJava usesJava reflection to find properties
and methods and the Java native code API to access
the Lua C API, an approach very similar to the one in LuaInterface.
On the extenderside, it uses dynamic generation of bytecodes to create Java classes from tables.
LuaJavagenerates
a class that delegates method calls to the Lua table, and this class is loaded by a
custom class loader.
The
Reflection.Emit API of the CLR makes this task much easier,
with its utility classes and methods for generating and loading memory-only classes.
LuaJava是java語言的一個腳本工具。 可以運行Lua腳本來使用java對象 和通過Lua Table來創建java類。
LuaJava使用java反射技術來查找屬性和方法,使用java JNI 來方法Lua C API .這種方式和LuaInterface非常相似。
在拓展方面,LuaJava使用動態生成字節碼方式從Lua Table中創建java類。
LuaJava生成java類作爲委託來訪問LuaTable,生成類是通過自定義類加載器加載。