似乎有一种方法可以配置
ObjectMapper为忽略所有非注释字段。
ObjectMapper mapper = new ObjectMapper();mapper.setVisibilityChecker(getSerializationConfig().getDefaultVisibilityChecker().withCreatorVisibility(JsonAutoDetect.Visibility.NONE).withFieldVisibility(JsonAutoDetect.Visibility.NONE).withGetterVisibility(JsonAutoDetect.Visibility.NONE).withIsGetterVisibility(JsonAutoDetect.Visibility.NONE).withSetterVisibility(JsonAutoDetect.Visibility.NONE));
资源
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)