Skip to content

Commit 3ba691d

Browse files
committed
Update README.md
1 parent ab3c60e commit 3ba691d

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,19 @@ when run from the commandline, it takes three arguments:
1010
<li>a url to a json file</li>
1111
<li>a package name for the classes it will generate</li>
1212
<li>the name of the base class to start with.</li>
13+
<li>optionally, the p option will make your classes parcelable.</li>
14+
<li>optionally, the g option will give your classes gson annotations for serialization.</li>
1315
</ul>
14-
e.g. java -jar JsonToJava http://example.com/folder.json com.example.api.model Folder
16+
java -jar JsonToJava.jar -url http://example.com/folder.json -package com.example.api.model -class Folder -p -g
17+
1518

1619
It will create the folder structure for the package you provide, then it will read the json at the url you provide, and output java classes into the folder locally.
1720

18-
Each class will implement Parcelable for easy passing of information in Android.
21+
Each class will implement Parcelable for easy passing of information in Android (optional).
1922
Each class will have a default empty constructor.
2023
The members of each class will follow Android naming conventions with an "m" prefix and camel case.
21-
Each member will have a corresponding static final String that relates it to it's json counterpart
22-
Each member will have a @SerializedName annotation for very easy Gson parsing.
24+
Each member will have a corresponding static final String that relates it to it's json counterpart
25+
Each member will have a @SerializedName annotation for very easy Gson parsing. (optional)
2326
If a member called "mId" or "mUniqueId" is found, then equals and hashcode will be overridden so comparisons are made on the id.
2427

2528
<h3>What I want this tool to do in the future in no particular order</h3>

0 commit comments

Comments
 (0)