|
参考:https://blog.csdn.net/zone_four/article/details/78355015
https://blog.csdn.net/stubbornness1219/article/details/52947013
fastJson过滤字段:https://blog.csdn.net/qingfeng812/article/details/73332034
fastjson使用教程:https://blog.csdn.net/srj1095530512/article/details/82529759
使用Jackson:设置json字符串动态过滤特定的属性:

对象嵌套的对象需要过滤字段:

PS:@JsonFilter(” “)修饰的对象,在转化成json字符串时一定要指定filter。要不会出错。
序列化与反序列化:
序列化:对象转化成字节序列的过程(对象通过输出流写到其他位置)
反序列化:字节序列转化成对象的过程(通过输入流写入对象)
实现序列化:
类 implements Serializable接口
implements Serializable 接口的类:
1.被 transient 修饰的属性是不会被序列化的
2.static修饰的属性也不会被序列化 |