阅读背景:

使用Gson将Java对象转换为JsonObject

来源:互联网 

I have a Java object, and I want to output it as a JSON string. BUT I want to avoid printing out a property in the Java object. I know that I could do this using GsonBuilder's excludeFieldsWithoutExposeAnnotation() method. However, I thought I'd try the alternate approach of removing the property from the JsonObject before printing it out. The following code works:I have a Java object, and I want to output it a




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: