Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 FastJSON 将 json 反序列化为对象。在反序列化期间,我想用空字符串自动替换 json 中的所有空值。是否有一个 JSON 参数可以做到这一点?否则,你有什么建议?
您可以使用方法并作为最后一个参数JSON.parseObject(String json, Class<T> clazz, Feature... features)传递。Feature.InitStringFieldAsEmpty
JSON.parseObject(String json, Class<T> clazz, Feature... features)
Feature.InitStringFieldAsEmpty