/** @param args */ public static void main(String[] args) { Printable p = new PrinterProxy("Alice"); System.out.println("名前は現在" + p.getPrinterName() + "です"); p.setPrinterName("Bob"); System.out.println("名前は現在" + p.getPrinterName() + "です"); p.print("Hello, world."); }
public static void main(String[] main_args) throws LuaException, ClassNotFoundException { LuaState L = LuaStateFactory.newLuaState(); L.openBase(); L.LdoString(str); LuaObject func = L.getLuaObject("imprime"); Object[] teste = func.call(new Object[] {"TESTANDO"}, 2); System.out.println(teste[0]); System.out.println(teste[1]); System.out.println("PROXY TEST :"); Printable p = new ObjPrint(); p.print("TESTE 1"); LuaObject o = L.getLuaObject("luaPrint"); p = (Printable) o.createProxy("org.keplerproject.luajava.test.Printable"); p.print("Teste 2"); L.close(); }