[关闭]
@linux1s1s 2016-11-18T08:26:02.000000Z 字数 2965 阅读 992

Android Studio Plugins

Tools


GsonFormat

Studio安装完成GsonFormat 以后按照以下截图操作即可

示例

在一个新建的类中右键--->> Generate(或者直接Alt+Insert)调出如下界面
此处输入图片的描述
选择GsonFormat即可
此处输入图片的描述
将需要自动生成JsonBean的json内容复制到这个对话框内,点击确定即可
此处输入图片的描述

结果

  1. public class StoreInfo {
  2. /**
  3. * address : 北京市西城区西单横二条2号华恒大厦二层
  4. * area : 1
  5. * business : 中成药、化学药制剂、抗生素、生化药品
  6. * charge : 王承德
  7. * count : 39
  8. * createdate : 1338393600000
  9. * fcount : 0
  10. * id : 79448
  11. * img : /store/081108/f0870383d818fe032ffb3368289aa5a3.jpg
  12. * leader : 张玉超
  13. * legal : 王承德
  14. * message :
  15. * name : 北京广安医药联合中心
  16. * number : 京AA0100174
  17. * rcount : 0
  18. * supervise : 37
  19. * tel : 010-82272120;010-68024691
  20. * type : 批发
  21. * url :
  22. * waddress : 北京市丰台区白盆窑村南京良路北555号
  23. * x : 116.377
  24. * y : 39.912
  25. * zipcode : 100000
  26. */
  27. private String address;
  28. private int area;
  29. private String business;
  30. private String charge;
  31. private int count;
  32. private long createdate;
  33. private int fcount;
  34. private int id;
  35. private String img;
  36. private String leader;
  37. private String legal;
  38. private String message;
  39. private String name;
  40. private String number;
  41. private int rcount;
  42. private int supervise;
  43. private String tel;
  44. private String type;
  45. private String url;
  46. private String waddress;
  47. private double x;
  48. private double y;
  49. private String zipcode;
  50. public String getAddress() {
  51. return address;
  52. }
  53. public void setAddress(String address) {
  54. this.address = address;
  55. }
  56. public int getArea() {
  57. return area;
  58. }
  59. public void setArea(int area) {
  60. this.area = area;
  61. }
  62. public String getBusiness() {
  63. return business;
  64. }
  65. public void setBusiness(String business) {
  66. this.business = business;
  67. }
  68. public String getCharge() {
  69. return charge;
  70. }
  71. public void setCharge(String charge) {
  72. this.charge = charge;
  73. }
  74. public int getCount() {
  75. return count;
  76. }
  77. public void setCount(int count) {
  78. this.count = count;
  79. }
  80. public long getCreatedate() {
  81. return createdate;
  82. }
  83. public void setCreatedate(long createdate) {
  84. this.createdate = createdate;
  85. }
  86. public int getFcount() {
  87. return fcount;
  88. }
  89. public void setFcount(int fcount) {
  90. this.fcount = fcount;
  91. }
  92. public int getId() {
  93. return id;
  94. }
  95. public void setId(int id) {
  96. this.id = id;
  97. }
  98. public String getImg() {
  99. return img;
  100. }
  101. public void setImg(String img) {
  102. this.img = img;
  103. }
  104. public String getLeader() {
  105. return leader;
  106. }
  107. public void setLeader(String leader) {
  108. this.leader = leader;
  109. }
  110. public String getLegal() {
  111. return legal;
  112. }
  113. public void setLegal(String legal) {
  114. this.legal = legal;
  115. }
  116. public String getMessage() {
  117. return message;
  118. }
  119. public void setMessage(String message) {
  120. this.message = message;
  121. }
  122. public String getName() {
  123. return name;
  124. }
  125. public void setName(String name) {
  126. this.name = name;
  127. }
  128. public String getNumber() {
  129. return number;
  130. }
  131. public void setNumber(String number) {
  132. this.number = number;
  133. }
  134. public int getRcount() {
  135. return rcount;
  136. }
  137. public void setRcount(int rcount) {
  138. this.rcount = rcount;
  139. }
  140. public int getSupervise() {
  141. return supervise;
  142. }
  143. public void setSupervise(int supervise) {
  144. this.supervise = supervise;
  145. }
  146. public String getTel() {
  147. return tel;
  148. }
  149. public void setTel(String tel) {
  150. this.tel = tel;
  151. }
  152. public String getType() {
  153. return type;
  154. }
  155. public void setType(String type) {
  156. this.type = type;
  157. }
  158. public String getUrl() {
  159. return url;
  160. }
  161. public void setUrl(String url) {
  162. this.url = url;
  163. }
  164. public String getWaddress() {
  165. return waddress;
  166. }
  167. public void setWaddress(String waddress) {
  168. this.waddress = waddress;
  169. }
  170. public double getX() {
  171. return x;
  172. }
  173. public void setX(double x) {
  174. this.x = x;
  175. }
  176. public double getY() {
  177. return y;
  178. }
  179. public void setY(double y) {
  180. this.y = y;
  181. }
  182. public String getZipcode() {
  183. return zipcode;
  184. }
  185. public void setZipcode(String zipcode) {
  186. this.zipcode = zipcode;
  187. }
  188. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注