Mercurial Hosting > luan
comparison core/src/luan/LuanPropertyMeta.java @ 416:91af5337b9ae
add LuanMeta.__tostring()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 30 Apr 2015 06:28:25 -0600 |
parents | ce8e19567911 |
children | 23a93c118042 |
comparison
equal
deleted
inserted
replaced
415:ce8e19567911 | 416:91af5337b9ae |
---|---|
13 return (LuanTable)tbl.getMetatable().get("get"); | 13 return (LuanTable)tbl.getMetatable().get("get"); |
14 } | 14 } |
15 | 15 |
16 public LuanTable setters(LuanTable tbl) { | 16 public LuanTable setters(LuanTable tbl) { |
17 return (LuanTable)tbl.getMetatable().get("set"); | 17 return (LuanTable)tbl.getMetatable().get("set"); |
18 } | |
19 | |
20 protected String type(LuanTable tbl) { | |
21 return (String)tbl.getMetatable().get("type"); | |
18 } | 22 } |
19 | 23 |
20 @Override public Object __index(LuanState luan,LuanTable tbl,Object key) throws LuanException { | 24 @Override public Object __index(LuanState luan,LuanTable tbl,Object key) throws LuanException { |
21 Object obj = getters(tbl).get(key); | 25 Object obj = getters(tbl).get(key); |
22 if( obj == null ) | 26 if( obj == null ) |
60 | 64 |
61 @Override public LuanTable newMetatable() { | 65 @Override public LuanTable newMetatable() { |
62 LuanTable mt = super.newMetatable(); | 66 LuanTable mt = super.newMetatable(); |
63 mt.put( "get", new LuanTable() ); | 67 mt.put( "get", new LuanTable() ); |
64 mt.put( "set", new LuanTable() ); | 68 mt.put( "set", new LuanTable() ); |
69 mt.put( "type", "property" ); | |
65 return mt; | 70 return mt; |
66 } | 71 } |
67 | 72 |
68 } | 73 } |