Class CoerceJavaToLua

java.lang.Object
com.prineside.luaj.lib.jse.CoerceJavaToLua

public class CoerceJavaToLua extends Object
Helper class to coerce values from Java to lua within the luajava library.

This class is primarily used by the org.luaj.vm2.lib.jse.LuajavaLib, but can also be used directly when working with Java/lua bindings.

To coerce scalar types, the various, generally the valueOf(type) methods on LuaValue may be used:

To coerce arrays of objects and lists, the listOf(..) and tableOf(...) methods on LuaValue may be used:

The method coerce(Object) looks as the type and dimesioning of the argument and tries to guess the best fit for corrsponding lua scalar, table, or table of tables.
See Also:
  • Constructor Details

    • CoerceJavaToLua

      public CoerceJavaToLua()
  • Method Details