This class represents a Lua object of any type. A LuaObject is constructed by a LuaState object using one of the four methods:
The LuaObject will represent only the object itself, not a variable or a stack index, so when you change a string, remember that strings are immutable objects in Lua, and the LuaObject you have will represent the old one.
Proxies
LuaJava allows you to implement a class in Lua, like said before. If you want to create this proxy from Java, you should have a LuaObject representing the table that has the functions that implement the interface. From this LuaObject you can call the createProxy(String implements)
. This method receives the string with the name of the interfaces implemented by the object separated by comma.
- Author
- Rizzato
-
Thiago Ponte
org.keplerproject.luajava.LuaObject.LuaObject |
( |
LuaState |
L, |
|
|
String |
globalName |
|
) |
| |
|
protected |
Creates a reference to an object in the variable globalName
- Parameters
-
Creates a reference to an object inside another object
- Parameters
-
parent | The Lua Table or Userdata that contains the Field. |
name | The name that index the field |
This constructor creates a LuaObject from a table that is indexed by a number.
- Parameters
-
parent | The Lua Table or Userdata that contains the Field. |
name | The name (number) that index the field |
- Exceptions
-
LuaException | When the parent object isn't a Table or Userdata |
This constructor creates a LuaObject from a table that is indexed by a LuaObject.
- Parameters
-
parent | The Lua Table or Userdata that contains the Field. |
name | The name (LuaObject) that index the field |
- Exceptions
-
LuaException | When the parent object isn't a Table or Userdata |
org.keplerproject.luajava.LuaObject.LuaObject |
( |
LuaState |
L, |
|
|
int |
index |
|
) |
| |
|
protected |
Creates a reference to an object in the given index of the stack
- Parameters
-
L | |
index | of the object on the lua stack |
Object [] org.keplerproject.luajava.LuaObject.call |
( |
Object[] |
args, |
|
|
int |
nres |
|
) |
| throws LuaException |
Calls the object represented by this
using Lua function pcall.
- Parameters
-
args | - Call arguments |
nres | - Number of objects returned |
- Returns
- Object[] - Returned Objects
- Exceptions
-
Object org.keplerproject.luajava.LuaObject.call |
( |
Object[] |
args | ) |
throws LuaException |
Calls the object represented by this
using Lua function pcall. Returns 1 object
- Parameters
-
- Returns
- Object - Returned Object
- Exceptions
-
Object org.keplerproject.luajava.LuaObject.createProxy |
( |
String |
implem | ) |
throws ClassNotFoundException, LuaException |
Function that creates a java proxy to the object represented by this
- Parameters
-
implem | Interfaces that are implemented, separated by , |
void org.keplerproject.luajava.LuaObject.finalize |
( |
| ) |
|
|
protected |
boolean org.keplerproject.luajava.LuaObject.getBoolean |
( |
| ) |
|
byte [] org.keplerproject.luajava.LuaObject.getBytes |
( |
| ) |
|
If this is a table or userdata tries to set a field value.
LuaState org.keplerproject.luajava.LuaObject.getLuaState |
( |
| ) |
|
double org.keplerproject.luajava.LuaObject.getNumber |
( |
| ) |
|
Object org.keplerproject.luajava.LuaObject.getObject |
( |
| ) |
throws LuaException |
String org.keplerproject.luajava.LuaObject.getString |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isBoolean |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isFunction |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isJavaFunction |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isJavaObject |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isNil |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isNumber |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isString |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isTable |
( |
| ) |
|
boolean org.keplerproject.luajava.LuaObject.isUserdata |
( |
| ) |
|
void org.keplerproject.luajava.LuaObject.push |
( |
| ) |
|
Pushes the object represented by this into L's stack
String org.keplerproject.luajava.LuaObject.toString |
( |
| ) |
|
int org.keplerproject.luajava.LuaObject.type |
( |
| ) |
|
LuaState org.keplerproject.luajava.LuaObject.L |
|
protected |
Integer org.keplerproject.luajava.LuaObject.ref |
|
protected |
The documentation for this class was generated from the following file:
- /Users/render/apps/BlowTorch/BTLib/src/org/keplerproject/luajava/LuaObject.java