Consider the following class:
private static class Widget {
@JsonProperty
private String id = "ID";
@JsonIgnore
private String jsonIgnored = "JSON_IGNORED";
private String noAnnotation = "NO_ANNOTATION";
}
如果我使用Jackson进行序列化,最终会得到以下字符串:
{"id":"ID"}
一个带有
@JsonIgnore
注解的属性和一个没有注解的属性之间有什么区别?