Skip to content

Commit

Permalink
1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzue committed Jan 3, 2024
1 parent 1b673f7 commit 90eee49
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
Binary file modified .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
4 changes: 2 additions & 2 deletions basejson/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
minSdkVersion 14
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 30
versionCode 15
versionName "1.2.2"
versionCode 16
versionName "1.2.3"
}

buildTypes {
Expand Down
23 changes: 22 additions & 1 deletion basejson/src/main/java/com/kongzue/baseokhttp/util/JsonList.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ public JsonList(String jsonStr) {
set(o);
}
}
if (isEmpty()) {
onEmpty(this, null);
} else {
onSuccess(this);
}
} catch (Exception e) {

onEmpty(this, e);
}
}

Expand All @@ -85,7 +90,13 @@ public JsonList(String jsonStr, boolean preParsing) {
set(o);
}
}
if (isEmpty()) {
onEmpty(this, null);
} else {
onSuccess(this);
}
} catch (Exception e) {
onEmpty(this, e);
}
}

Expand Down Expand Up @@ -365,4 +376,14 @@ public JsonList preBuild(int preBuildIndex, JsonList parentJsonList) {
this.parentJsonList = parentJsonList;
return this;
}

// 构建中用于复写的成功状态
public void onSuccess(JsonList thisJson) {

}

// 构建中用于复写的空/异常内容状态
public void onEmpty(JsonList thisJson, Exception e) {

}
}
24 changes: 22 additions & 2 deletions basejson/src/main/java/com/kongzue/baseokhttp/util/JsonMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ public JsonMap(String jsonStr) {
put(key, value);
}
}
if (isEmpty()) {
onEmpty(this, null);
} else {
onSuccess(this);
}
} catch (Exception e) {

onEmpty(this, e);
}
}

Expand All @@ -103,8 +108,13 @@ public JsonMap(String jsonStr, boolean preParsing) {
put(key, value);
}
}
if (isEmpty()) {
onEmpty(this, null);
} else {
onSuccess(this);
}
} catch (Exception e) {

onEmpty(this, e);
}
}

Expand Down Expand Up @@ -367,4 +377,14 @@ public JsonMap preBuild(int preBuildIndex, JsonList parentJsonList) {
this.parentJsonList = parentJsonList;
return this;
}

// 构建中用于复写的成功状态
public void onSuccess(JsonMap thisJson) {

}

// 构建中用于复写的空/异常内容状态
public void onEmpty(JsonMap thisJson, Exception e) {

}
}

0 comments on commit 90eee49

Please sign in to comment.