Skip to content

Commit

Permalink
feat: parse支持reader流加载
Browse files Browse the repository at this point in the history
  • Loading branch information
qw623577789 committed Oct 21, 2022
1 parent 3e59de0 commit 24e5ff9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repositories {
}
dependencies {
implementation 'com.github.qw623577789:qtk-json:v1.13.0'
implementation 'com.github.qw623577789:qtk-json:1.14.0'
}
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {
}

group = "team.qtk"
version = "1.13.0"
version = "1.14.0"
sourceCompatibility = 11
targetCompatibility = 11

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/team/qtk/json/JSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import team.qtk.json.point.Point.DefaultValueMap;

import java.io.File;
import java.io.Reader;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
Expand Down Expand Up @@ -118,6 +119,8 @@ private static JSON parse(ObjectMapper jacksonMapper, Object object) {
: new JSON(jacksonMapper.valueToTree(object).deepCopy(), jacksonMapper);
} else if (object instanceof File) {
return new JSON(jacksonMapper.readTree((File) object), jacksonMapper);
} else if (object instanceof Reader) {
return new JSON(jacksonMapper.readTree((Reader) object), jacksonMapper);
} else {
return new JSON(jacksonMapper.valueToTree(object).deepCopy(), jacksonMapper);
}
Expand Down

0 comments on commit 24e5ff9

Please sign in to comment.