2020
10-10
10-10
java jackson 将对象转json时,忽略子对象的某个属性操作
我就废话不多说了,大家还是直接看代码吧~//父对象publicclassuserimplementsjava.io.Serializable{@JsonIgnoreProperties(value={"addressId"})//在解析成json时,忽略子属性的addressId字段privateAddressaddress;privateStringusername;//.........}//子对象publicclassAddressimplementsjava.io.Serializable{privateintaddressId;privateStringaddress;privateStringphone;//..........}//注:当对象是hi...
继续阅读 >