【发布时间】:2013-01-31 13:08:30
【问题描述】:
我正在尝试使用以下代码为我的一个 POJO 创建一个 mixin:
interface CustomerStatsIgnoreMixIn {
@JsonIgnoreProperties({"ref"});
}
public class CustomerStatsJob extends Job {
private void updateCustomer(Customer customer) {
ObjectMapper mapper = new ObjectMapper();
mapper.getSerializationConfig().addMixInAnnotations(Customer.class,
CustomerStatsIgnoreMixIn.class);
}
}
我在 @JsonIgnoreProperties({"ref"}); 行的 Eclipse 中收到以下错误
此行有多个标记 - 语法错误,插入“枚举标识符”以完成 EnumHeaderName - 语法错误,插入“EnumBody”来完成EnumDeclaration
我确定这很愚蠢,但你知道问题是什么吗?
【问题讨论】: