Skip to content

Commit

Permalink
修改使用包装类型
Browse files Browse the repository at this point in the history
  • Loading branch information
liuzhihang committed Feb 27, 2020
1 parent 98df158 commit a768a46
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Toolkit

更新
----
## [v1.0.6](https://github.com/liuzhihangs/toolkit/releases/tag/v1.0.6) (2020-02-19)
## [v1.0.7](https://github.com/liuzhihangs/toolkit/releases/tag/v1.0.7) (2020-02-27)

- 支持Base64 decode encode
- 修改使用包装类型

[查看更多历史更新记录](./doc/ChangeNotes.md)

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

group 'com.liuzhihang.toolkit'
version '1.0.6'
version '1.0.7'

sourceCompatibility = 1.8

Expand Down
6 changes: 6 additions & 0 deletions doc/ChangeNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# ChangeNotes


## [v1.0.7](https://github.com/liuzhihangs/toolkit/releases/tag/v1.0.7) (2020-02-27)

- 修改使用包装类型


## [v1.0.6](https://github.com/liuzhihangs/toolkit/releases/tag/v1.0.6) (2020-02-19)

- 支持Base64 decode encode
Expand Down
12 changes: 4 additions & 8 deletions parts/changeNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@

<h4>English introduction</h4>
<ul>
<li>1.0.6
<li>1.0.7
<ol>
<li>Support Base64 decode and encode</li>
<li>Support Url decode and encode</li>
<li>Fix: NullPointerException are reported when used outside Java objects</li>
<li>Modify the type of packaging used</li>
</ol>
</li>
<li><a href="https://github.com/liuzhihangs/toolkit/blob/master/doc/ChangeNotes.md">More records</a></li>
</ul>
<h4>中文介绍</h4>
<ul>
<li>1.0.6
<li>1.0.7
<ol>
<li>支持 Base64 decode and encode</li>
<li>支持 Url decode and encode</li>
<li>Fix: 在Java对象外使用时会报空指针异常的现象</li>
<li>修改使用包装类型</li>
</ol>
</li>
<li><a href="https://github.com/liuzhihangs/toolkit/blob/master/doc/ChangeNotes.md">更多记录</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ private List<RowBean> buildRowBeanList(JsonObject jsonObject, Project project) {
continue;
}
if (asJsonPrimitive.isBoolean()) {
rowBean.setPsiType(PsiType.BOOLEAN);
rowBean.setPsiType(psiElementFactory.createTypeFromText("java.lang.Boolean", null));
} else if (asJsonPrimitive.isString()) {
rowBean.setPsiType(stringPsiType);
} else if (asJsonPrimitive.isNumber()) {
rowBean.setPsiType(asString.contains(".") ? PsiType.DOUBLE : PsiType.LONG);
rowBean.setPsiType(asString.contains(".") ? psiElementFactory.createTypeFromText("java.lang.Double", null) : psiElementFactory.createTypeFromText("java.lang.Long", null));
}
} else {
// rowBean.typeName = jsonElement.getClass().getSimpleName();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/liuzhihang/toolkit/ui/JsonFormat.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ private void doGenerate(PsiClass aClass, JsonObject jsonObject) {
continue;
}
if (asJsonPrimitive.isBoolean()) {
psiType = PsiType.BOOLEAN;
psiType = psiElementFactory.createTypeFromText("java.lang.Boolean", null);
} else if (asJsonPrimitive.isNumber()) {
psiType = asString.contains(".") ? PsiType.DOUBLE : PsiType.LONG;
psiType = asString.contains(".") ? psiElementFactory.createTypeFromText("java.lang.Double", null) : psiElementFactory.createTypeFromText("java.lang.Long", null);
} else {
psiType = stringPsiType;
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a768a46

Please sign in to comment.