org.luaj.vm2.lib.jse
Class CoerceLuaToJava
java.lang.Object
org.luaj.vm2.lib.jse.CoerceLuaToJava
public class CoerceLuaToJava
- extends java.lang.Object
Helper class to coerce values from lua to Java within the luajava library.
This class is primarily used by the LuajavaLib
,
but can also be used directly when working with Java/lua bindings.
To coerce to specific Java values, generally the toType()
methods
on LuaValue
may be used:
For data in lua tables, the various methods on LuaTable
can be used directly
to convert data to something more useful.
- See Also:
LuajavaLib
,
CoerceJavaToLua
Method Summary |
static java.lang.Object |
coerce(LuaValue value,
java.lang.Class clazz)
Coerce a LuaValue value to a specified java class |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CoerceLuaToJava
public CoerceLuaToJava()
coerce
public static java.lang.Object coerce(LuaValue value,
java.lang.Class clazz)
- Coerce a LuaValue value to a specified java class
- Parameters:
value
- LuaValue to coerceclazz
- Class to coerce into
- Returns:
- Object of type clazz (or a subclass) with the corresponding value.
Copyright © 2007-2008 Luaj.org. All Rights Reserved.