当前位置: 首页 > 工具软件 > LuaJava > 使用案例 >

LuaJava:

上官凯泽
2023-12-01



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 tables

On 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,生成类是通过自定义类加载器加载。




 类似资料:

相关阅读

相关文章

相关问答