素材巴巴 > 程序开发 >

工具插件:JSON转JavaBean工具(GsonFormat)

程序开发 2023-09-19 21:29:46

简介

GsonFormat是一款根据Gson库使用的要求,将JSONObject格式的String 解析成实体的插件。这是一个根据JSONObject格式的字符串,自动生成实体类参数,本插件只适用 android studio和 Intellij IDEA 工具。

安装

FileSettingsPluginsBrowse Repositories

实践

{"test": {"tools": [{"name": "GsonFormat","varsion": "1.0.0"
 }]}}
 

image.png

image.png

image.png

    /*** test : {"tools":[{"name":"GsonFormat","varsion":"1.0.0"}]}*/private TestBean test;public TestBean getTest() {return test;}public void setTest(TestBean test) {this.test = test;}public static class TestBean {private List tools;public List getTools() {return tools;}public void setTools(List tools) {this.tools = tools;}public static class ToolsBean {/*** name : GsonFormat* varsion : 1.0.0*/private String name;private String varsion;public String getName() {return name;}public void setName(String name) {this.name = name;}public String getVarsion() {return varsion;}public void setVarsion(String varsion) {this.varsion = varsion;}}}
 

标签:

上一篇: 调试React Native项目(webstorm) 下一篇:
素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。