Skip to content

Commit d7bd009

Browse files
authored
Update README.md
1 parent e877e32 commit d7bd009

File tree

1 file changed

+37
-30
lines changed

1 file changed

+37
-30
lines changed

README.md

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,42 @@ also as say a plugin for Kotlin to convert JSON String into Kotlin data class co
2020
### Overview
2121
Hi,This is a very cool tool for Kotlin developers ,It can convert the Json String into Kotlin Data Class code ,and paste it into your editor file ,The tool could recognize the Primitive Type of Json String and make Type Identifier respectively ,It taste easily ,Just have test,guys! Just press shortcut key `ALT` + `K` for Windows or `Option` + `K` for Mac,And then,start your Kotlin program travel ! JsonToKotlinClass make program more happy!
2222

23+
### Easy Use
24+
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_18032.png)
25+
26+
#### Want to generate classes code in inner class model? Do like this.
27+
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_18031.png)
28+
29+
#### Want to generate Kotlin data class file directory? Do like this.
30+
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_18030.png)
31+
32+
#### Want to generate Kotlin data classes in single file directory? Do like this.
33+
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_18029.png)
34+
35+
### Usage
36+
* Search 'JsonToKotlinClass' in Intellij Idea Plugin Repositroy Or AndroidStudio Plugin Repository And Install it.</br>
37+
File --> Settings --> Plugins --> Browse Repositories -->Search JsonToKotlinClass
38+
* Restart your Develop tools
39+
* Press shortcut key `ALT` + `K` for Windows or `Option` + `K` for Mac And Then you will know how to use
40+
2341
### Features
2442
* Generate Kotlin data class from any legal JSON text.
25-
* Support JSON Serialize Lib Annotation(Gson,Jackson,Fastjson,MoShi and LoganSquare)
43+
* Generate Kotlin data class File form any legal JSON text when right click on directory and select `New` -> `Kotlin data class File from JSON`.
44+
* Support JSON Serialize Lib Annotation(Gson,Jackson,Fastjson,MoShi and LoganSquare,kotlinx.serialize(default custom value))
2645
* Support customize your own Annotation
2746
* Support init property with default value
2847
* Support make property type to be nullable(?)
48+
* Support auto make sure property type to be nullable(?) or not
2949
* Support auto rename property name to be camelCase when select a target JSON lib Annotation.[See demo](#configure-with-gson-support-on-and-init-with-deault-value-on-and-comment-off)
3050
* Support generate kotlin data class code in split model
3151
* Support generate kotlin data class code in inner class model
52+
* Support generate kotlin data class File in inner class model
53+
* Support generate kotlin data class File in split files
3254
* Support format any legal JSON string
55+
* Support Generate Map Type
3356

34-
### How to use
35-
* Search 'JsonToKotlinClass' in Intellij Idea Plugin Repositroy Or AndroidStudio Plugin Repository And Install it.</br>
36-
File --> Settings --> Plugins --> Browse Repositories -->Search JsonToKotlinClass
37-
* Restart your Develop tools
38-
* Press shortcut key `ALT` + `K` for Windows or `Option` + `K` for Mac And Then you will know how to use
39-
### Demos
40-
#### Default :
41-
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_17468.png)
42-
43-
#### Configure with Gson support on and init with deault value on and comment off
44-
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_17469.png)
45-
46-
#### Config with custome your own annotations support on and init with deault value on
47-
48-
![alt text](https://plugins.jetbrains.com/files/9960/screenshot_17470.png)
49-
50-
### Generate Example
51-
* Example with none json lib support and comment option on
57+
### Generate Example
58+
* Default
5259

5360
```kotlin
5461
data class FD(
@@ -58,25 +65,25 @@ Hi,This is a very cool tool for Kotlin developers ,It can convert the Json Strin
5865
)
5966

6067
data class Musician(
61-
val firstName: String, //Eric
62-
val lastName: String, //Clapton
63-
val instrument: String //guitar
68+
val firstName: String,
69+
val lastName: String,
70+
val instrument: String
6471
)
6572

6673
data class Author(
67-
val firstName: String, //Isaac
68-
val lastName: String, //Asimov
69-
val genre: String //science fiction
74+
val firstName: String,
75+
val lastName: String,
76+
val genre: String
7077
)
7178

7279
data class Programmer(
73-
val firstName: String, //Brett
74-
val lastName: String, //McLaughlin
75-
val email: String //aaaa
80+
val firstName: String,
81+
val lastName: String,
82+
val email: String
7683
)
7784

7885
```
79-
* Example with gson option on and init with default value option on
86+
* Example with gson option on and init with default value option on in settings
8087

8188
```kotlin
8289

@@ -89,7 +96,7 @@ Hi,This is a very cool tool for Kotlin developers ,It can convert the Json Strin
8996
)
9097

9198
data class TrainScheduleBody(
92-
@SerializedName("mxl") val mxl: Long = 0, //12490639969101
99+
@SerializedName("mxl") val mxl: Long = 0,
93100
@SerializedName("content") val content: List<Int> = listOf()
94101
)
95102

0 commit comments

Comments
 (0)