comparison src/luan/lib/HtmlLib.java @ 112:f5af13062b10

fix previous rev git-svn-id: https://luan-java.googlecode.com/svn/trunk@113 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Fri, 23 May 2014 22:52:39 +0000
parents 3c404a296995
children f537ff5e511d
comparison
equal deleted inserted replaced
111:2428ecfed375 112:f5af13062b10
9 public final class HtmlLib { 9 public final class HtmlLib {
10 10
11 public static final String NAME = "Html"; 11 public static final String NAME = "Html";
12 12
13 public static final LuanFunction LOADER = new LuanFunction() { 13 public static final LuanFunction LOADER = new LuanFunction() {
14 @Override public Object[] call(LuanState luan,Object[] args) { 14 @Override public Object call(LuanState luan,Object[] args) {
15 LuanTable module = new LuanTable(); 15 LuanTable module = new LuanTable();
16 try { 16 try {
17 add( module, "encode", String.class ); 17 add( module, "encode", String.class );
18 } catch(NoSuchMethodException e) { 18 } catch(NoSuchMethodException e) {
19 throw new RuntimeException(e); 19 throw new RuntimeException(e);
20 } 20 }
21 return new Object[]{module}; 21 return module;
22 } 22 }
23 }; 23 };
24 24
25 private static void add(LuanTable t,String method,Class<?>... parameterTypes) throws NoSuchMethodException { 25 private static void add(LuanTable t,String method,Class<?>... parameterTypes) throws NoSuchMethodException {
26 t.put( method, new LuanJavaFunction(HtmlLib.class.getMethod(method,parameterTypes),null) ); 26 t.put( method, new LuanJavaFunction(HtmlLib.class.getMethod(method,parameterTypes),null) );