| java.lang.Object org.keplerproject.luajava.LuaJavaAPI
LuaJavaAPI | final public class LuaJavaAPI (Code) | | Class that contains functions accessed by lua.
author: Thiago Ponte |
Method Summary | |
public static int | checkField(int luaState, Object obj, String fieldName) | public static int | checkMethod(int luaState, Object obj, String methodName) Checks to see if there is a method with the given name. | public static int | classIndex(int luaState, Class clazz, String searchName) Java function to be called when a java Class metamethod __index is called. | public static int | createProxyObject(int luaState, String implem) | public static int | javaLoadLib(int luaState, String className, String methodName) Calls the static method methodName in class className
that receives a LuaState as first parameter. | public static int | javaNew(int luaState, Class clazz) | public static int | javaNewInstance(int luaState, String className) | public static int | objectIndex(int luaState, Object obj, String methodName) |
checkField | public static int checkField(int luaState, Object obj, String fieldName) throws LuaException(Code) | | Checks if there is a field on the obj with the given name
Parameters: luaState - int that represents the state to be used Parameters: obj - object to be inspected Parameters: fieldName - name of the field to be inpected number of returned objects |
checkMethod | public static int checkMethod(int luaState, Object obj, String methodName)(Code) | | Checks to see if there is a method with the given name.
Parameters: luaState - int that represents the state to be used Parameters: obj - object to be inspected Parameters: methodName - name of the field to be inpected number of returned objects |
classIndex | public static int classIndex(int luaState, Class clazz, String searchName) throws LuaException(Code) | | Java function to be called when a java Class metamethod __index is called.
This function returns 1 if there is a field with searchName and 2 if there
is a method if the searchName
Parameters: luaState - int that represents the state to be used Parameters: clazz - class to be indexed Parameters: searchName - name of the field or method to be accessed number of returned objects throws: LuaException - |
createProxyObject | public static int createProxyObject(int luaState, String implem) throws LuaException(Code) | | Function that creates an object proxy and pushes it into the stack
Parameters: luaState - int that represents the state to be used Parameters: implem - interfaces implemented separated by comma (, ) number of returned objects throws: LuaException - |
javaLoadLib | public static int javaLoadLib(int luaState, String className, String methodName) throws LuaException(Code) | | Calls the static method methodName in class className
that receives a LuaState as first parameter.
Parameters: luaState - int that represents the state to be used Parameters: className - name of the class that has the open library method Parameters: methodName - method to open library number of returned objects throws: LuaException - |
javaNew | public static int javaNew(int luaState, Class clazz) throws LuaException(Code) | | javaNew returns a new instance of a given clazz
Parameters: luaState - int that represents the state to be used Parameters: clazz - class to be instanciated number of returned objects throws: LuaException - |
javaNewInstance | public static int javaNewInstance(int luaState, String className) throws LuaException(Code) | | Pushes a new instance of a java Object of the type className
Parameters: luaState - int that represents the state to be used Parameters: className - name of the class number of returned objects throws: LuaException - |
objectIndex | public static int objectIndex(int luaState, Object obj, String methodName) throws LuaException(Code) | | Java implementation of the metamethod __index
Parameters: luaState - int that indicates the state used Parameters: obj - Object to be indexed Parameters: methodName - the name of the method number of returned objects |
|
|