像这样设置对象映射器:
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibilityChecker(mapper.getDeserializationConfig().getDefaultVisibilityChecker()
.withCreatorVisibility(JsonAutoDetect.Visibility.NONE)
.withFieldVisibility(JsonAutoDetect.Visibility.NONE)
.withGetterVisibility(JsonAutoDetect.Visibility.NONE)
.withIsGetterVisibility(JsonAutoDetect.Visibility.NONE)
.withSetterVisibility(JsonAutoDetect.Visibility.NONE));
Run Code Online (Sandbox Code Playgroud)
Horte的积分:)
| 归档时间: |
|
| 查看次数: |
1470 次 |
| 最近记录: |