当前位置:首页 > 未命名 > 正文内容

Gson 解析json时遇到key是数字,关键字,key中带小数点等问题的解决办法

dsttl35年前 (2019-04-24)未命名96

json示例

{
"dsttl3.cn": "https://www.dsttl3.cn",
"new": "new",
"001": "001"
}

Entity

//需引入gson包
import com.google.gson.annotations.SerializedName;
//
@SerializedName("dsttl3.cn") //dsttl3.cn 为key
String dsttl3_cn;
@SerializedName("new")
String _new;
@SerializedName("001")
String _001;

扫描二维码推送至手机访问。

版权声明:本文由dsttl3发布,如需转载请注明出处。

本文链接:https://dsttl3.cn/?id=221

分享给朋友: