Skip to content

Commit

Permalink
1.2.6.3.1
Browse files Browse the repository at this point in the history
- 支持通过 getParentJsonMap() 和 getParentJsonList() 获取 JsonMap 和 JsonList 的父对象。
  • Loading branch information
kongzue committed Jul 12, 2024
1 parent 809974a commit a87acf0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion basejson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 30
versionCode 19
versionName "1.2.6.3"
versionName "1.2.6.3.1"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ public JsonList(String jsonStr) {
if (privateParsing) {
if (o.startsWith("{") && o.endsWith("}")) {
JsonMap value = new JsonMap(o);
value.setParentJsonList(this);
set(value.isEmpty() ? o : value);
} else if (o.startsWith("[") && o.endsWith("]")) {
JsonList value = new JsonList(o);
value.setParentJsonList(this);
set(value.isEmpty() ? o : value);
} else {
set(o);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ public JsonMap(String jsonStr) {
if (privateParsing) {
if (value.startsWith("{") && value.endsWith("}")) {
JsonMap object = new JsonMap(value);
object.setParentJsonMap(this);
put(key, object.isEmpty() ? value : object);
} else if (value.startsWith("[") && value.endsWith("]")) {
JsonList array = new JsonList(value);
array.setParentJsonMap(this);
put(key, array.isEmpty() ? value : array);
} else {
put(key, value);
Expand Down

0 comments on commit a87acf0

Please sign in to comment.