草庐IT

UpperCamelCase

全部标签

java - 对象序列化为 JSON(使用 Gson)。如何在 UpperCamelCase 中设置字段名称?

我需要使用GoogleGson库将简单的Java对象列表序列化为JSON。对象:publicclassSimpleNode{privateStringimageIndex;privateStringtext;publicStringgetImageIndex(){returnimageIndex;}publicvoidsetImageIndex(StringimageIndex){this.imageIndex=imageIndex;}publicStringgetText(){returntext;}publicvoidsetText(Stringtext){this.text=te

java - 对象序列化为 JSON(使用 Gson)。如何在 UpperCamelCase 中设置字段名称?

我需要使用GoogleGson库将简单的Java对象列表序列化为JSON。对象:publicclassSimpleNode{privateStringimageIndex;privateStringtext;publicStringgetImageIndex(){returnimageIndex;}publicvoidsetImageIndex(StringimageIndex){this.imageIndex=imageIndex;}publicStringgetText(){returntext;}publicvoidsetText(Stringtext){this.text=te