1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-08-24 00:32:13 -04:00
parent df10db140c
commit ed911e3de5
220 changed files with 2618 additions and 1569 deletions

View File

@@ -85,7 +85,7 @@ class Luaj_value_ {
}
public static LuaValue X_obj_to_val(Luaj_server server, Object o) {
if (o == null) return LuaValue.NIL;
Class<?> c = ClassAdp_.ClassOf_obj(o);
Class<?> c = Type_adp_.ClassOf_obj(o);
if (Object_.Eq(c, Bool_.Cls_ref_type)) return LuaValue.valueOf((Boolean)o);
else if (Object_.Eq(c, Int_.Cls_ref_type)) return LuaValue.valueOf((Integer)o);
else if (Object_.Eq(c, Double_.Cls_ref_type)) return LuaValue.valueOf((Double)o);

View File

@@ -81,7 +81,7 @@ public class Process_send_wtr {
}
public boolean Encode_obj(Bry_bfr bfr, Object o) {
if (o == null) {bfr.Add(CONST_nil); return true;}
Class<?> c = ClassAdp_.ClassOf_obj(o);
Class<?> c = Type_adp_.ClassOf_obj(o);
if (Object_.Eq(c, Bool_.Cls_ref_type)) Encode_bool(bfr, Bool_.cast_(o));
else if (Object_.Eq(c, Int_.Cls_ref_type)) Encode_int(bfr, Int_.cast_(o));
else if (Object_.Eq(c, Double_.Cls_ref_type)) {if (!Encode_double(bfr, Double_.cast_(o))) return false;}
@@ -90,7 +90,7 @@ public class Process_send_wtr {
else if (Object_.Eq(c, Scrib_lua_proc.class)) {if (!Encode_prc(bfr, (Scrib_lua_proc)o)) return false;}
else if (Object_.Eq(c, KeyVal.class)) {if (!Encode_kv(bfr, (KeyVal)o)) return false;}
else if (Object_.Eq(c, KeyVal[].class)) {if (!Encode_ary(bfr, (KeyVal[])o)) return false;}
else {throw Scrib_xtn_mgr.err_("Object cannot be serialized: {0}", ClassAdp_.NameOf_obj(o));}
else {throw Scrib_xtn_mgr.err_("Object cannot be serialized: {0}", Type_adp_.NameOf_obj(o));}
return true;
}
private static final byte[] CONST_nil = Bry_.new_a7("nil"), CONST_bool_true = Bry_.new_a7("true"), CONST_bool_false = Bry_.new_a7("false"), CONST_escape_000 = Bry_.new_a7("\\000");

View File

@@ -71,10 +71,10 @@ class Process_server_mock_rcvd_val implements Process_server_mock_rcvd {
continue;
}
Class<?> kv_val_type = kv_val.getClass();
boolean kv_val_is_array = ClassAdp_.Eq(kv_val_type, KeyVal[].class);
boolean kv_val_is_array = Type_adp_.Eq(kv_val_type, KeyVal[].class);
if (print_key && !kv_val_is_array)
bfr.Add_str(kv.Key()).Add_byte(Byte_ascii.Colon);
if (ClassAdp_.Eq(kv_val_type, Bool_.Cls_ref_type))
if (Type_adp_.Eq(kv_val_type, Bool_.Cls_ref_type))
bfr.Add(Bool_.cast_(kv_val) ? gplx.core.json.Json_itm_.Const_true : gplx.core.json.Json_itm_.Const_false);
else if (kv_val_is_array) {
KeyVal[] sub = (KeyVal[])kv_val;