在json-lib中如何不序列化某些字段 
1.在字段的定义前加上关键字transient
    private transient Exep exep ;
2.调用序列化操作时:
 

  JsonConfig jsonConfig = new JsonConfig();

  jsonConfig.setIgnoreTransientFields(true);//设置为不序列化 transient的字段

  String objectJson = JSONArray.fromObject(Object,jsonConfig).toString();

相关文章:

  • 2021-07-05
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-30
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案