From 0b0641dbc28e69dc44fe9c4af22c7d80afc4fcb2 Mon Sep 17 00:00:00 2001 From: miktim Date: Thu, 17 Oct 2024 11:14:59 +0300 Subject: [PATCH] 3.0.1 --- dist/{json-3.0.0.jar => json-3.0.1.jar} | Bin 21099 -> 21248 bytes src/org/miktim/json/Json.java | 7 +++++- src/org/miktim/json/JsonObject.java | 2 +- test/json/JsonObjectTest.java | 30 ++++++++++++------------ 4 files changed, 22 insertions(+), 17 deletions(-) rename dist/{json-3.0.0.jar => json-3.0.1.jar} (61%) diff --git a/dist/json-3.0.0.jar b/dist/json-3.0.1.jar similarity index 61% rename from dist/json-3.0.0.jar rename to dist/json-3.0.1.jar index 3cd9c37549e4195605fb116a176d657c1f0383df..8596ff93de025aed6d9eb738c57ab659f24ab2e6 100644 GIT binary patch delta 6039 zcmZvgcQl;cx5tM>@4^thzIrD*38D^08!gd$8Ab^rF}fI0NAJCi-U$+Ih~B*?qP$$ON=tsF~$<&aeava0KCCOlHt(Sw_-pse#`Y-4|XyB=or$w ziOs+Dy}!CN)@KZ&`@C?&Fltpy0AL4MOF~!Ai(`y=pB8~ffQff6*Q=PgOd=~unCjaI z*8fz@C3^TLq?iQz539)jvgr}-pLr)G*`K&6;0L_>Qn5^qe|XKsKty(5avEo+_Xhv~ z2>ksvoX9*33b>~mluiBjpy&pDW$WQ(>%njBV(IA_7FVm)BS;$l%Xun1G*Mx<7yBE4 z(8hw-Dl+sT!UEv!6O2V1$tMYA#5$n?sS?TnNWvs=fQ9OFlZ){0a5;_dKQ8VtRw$;Z z-@aGe4^1Tvw^!%!(b{2T;KO}pcgSv;$-`HjqRD&!&*F4C1bOHoUNcvmUbu<4$D-KZ zSD6%u6c|oQIpPfz%}&}iI+zYz@`_(FyG|qZG);ukUk6-nPh^rVrx)>UhMgi=kFxcx z*vTJKht9Fn-O7j8G!uW|;x?A*_R5NUd+y76M{0f-yIUZbK}Qf2wS4PQ-x7xQ|@Z7P2tL(IT)GS} z$hx!)J}C~oh4L*;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CnyX{-$A T castMember(Class cls, String memberName, int... indices) { public Json normalize() throws IOException, ParseException { return (Json) JSON.fromJSON(this.toString()); // :) } - + + public static class JsonConverter extends JsonObject { + public JsonConverter() { + + }} + public static JsonConverter converter = new JsonConverter(); } diff --git a/src/org/miktim/json/JsonObject.java b/src/org/miktim/json/JsonObject.java index 429509a..8b6b9a9 100644 --- a/src/org/miktim/json/JsonObject.java +++ b/src/org/miktim/json/JsonObject.java @@ -73,7 +73,7 @@ protected void onError(String name, Exception e) { */ @SuppressWarnings("unchecked") - protected T castMember(String memberName, Json jsonObj, T sample) { + protected T castMember(T sample, String memberName, Json jsonObj) { if (jsonObj.get(memberName) != null) { return JSON.cast(jsonObj.get(memberName), sample); } diff --git a/test/json/JsonObjectTest.java b/test/json/JsonObjectTest.java index 54cee8c..b8c5a56 100644 --- a/test/json/JsonObjectTest.java +++ b/test/json/JsonObjectTest.java @@ -7,7 +7,6 @@ import java.util.HashMap; import java.util.Map; import org.miktim.json.Json; -import org.miktim.json.JsonConverter; import org.miktim.json.JsonObject; public class JsonObjectTest { @@ -76,7 +75,7 @@ static class D { protected String pro_dS = "protected dS"; public int pub_di = 123; - String dS = ""; + String def_S = ""; public C pub_dC = new C(); private String pri_dS; @@ -85,7 +84,7 @@ static class D { D(int i, String s) { pub_di = i; - dS = s; + def_S = s; } } @@ -116,7 +115,7 @@ class B extends A { @Override protected Object replacer(String name, Object value) { - log(name); +// log(name); try { if (isClassName(name)) { // first call // ignored field was declared in A @@ -138,7 +137,7 @@ protected Object reviver(String name, Object value) { try { if (isClassName(name)) { // load a.priv_ad by setter - set_ad(castMember("ad", (Json) value, get_ad())); + set_ad(castMember(get_ad(),"ad", (Json) value)); } else if (name.endsWith(".bD")) { return fromJson(bD, (Json) value); } @@ -232,27 +231,28 @@ public static void main(String[] args) throws Exception { t.av.enableNames = false; t.av.fromJson(j); log(t.av.toJson()); - + log(" Av instance with Json.converter"); + log(Json.converter.toJson(t.av)); + log("\n\r B instance toJson/fromJson :"); String s = t.b.toJson().toJSON(); log(s); t.b.fromJson(new Json(s)); - JsonConverter converter = new JsonConverter(); - log("\n\r D instance with default converter:"); - j = converter.toJson(t.d); + log("\n\r D instance with Json.converter:"); + j = Json.converter.toJson(t.d); log(j); log(" load updated Json into new D instance"); j.set("pro_dS", "updated dS").set("pub_di", 0); - t.d = converter.fromJson(new D(), j); - log(converter.toJson(t.d)); + t.d = Json.converter.fromJson(new D(), j); + log(Json.converter.toJson(t.d)); - log("\n\r B instance with default converter:"); - j = converter.toJson(t.b); + log("\n\r B instance with Json.converter:"); + j = Json.converter.toJson(t.b); log(j); - log("\n\r java.lang.reflect.Modifier instance with default converter:"); - j = converter.toJson(new Modifier()); + log("\n\r java.lang.reflect.Modifier instance with Json.converter:"); + j = Json.converter.toJson(new Modifier()); log(j); }