LuaJava API Compatibility
The original LuaJava provides the following Lua API:
luajava.newInstance
luajava.bindClass
luajava.new
luajava.createProxy
luajava.loadLib
By default, we do not offer these bindings. However, you may very easily adapt the java
APIs to luajava
ones.
lua
local luajava = {
newInstance = function (className, ...)
return java.import(className)(...)
end,
bindClass = java.import,
new = java.new,
createProxy = java.proxy,
loadLib = function (className, methodName)
return java.loadlib(className, methodName)()
end,
}
return luajava
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17