我有一个包含 java.util.Set 的 bean,当我尝试填充 Set 时,我得到了BeanException: Index property is not an array, list or map
. 为什么 Jodd 不支持 Set ?我的豆子看起来像:
public class ShippingRule {
private Set<String> returnConstraints;
public Set<String> getReturnConstraints() {
return returnConstraints;
}
public void setReturnConstraints(Set<String> returnConstraints) {
this.returnConstraints = returnConstraints;
}
}
我填充:
ShippingRule shippingRule = new ShippingRule();
BeanUtil.setPropertyForced(shippingRule, "returnConstraints[0]", "restrict1");
BeanUtil.setPropertyForced(shippingRule, "returnConstraints[1]", "restrict2");
我错过了什么吗?请指教,谢谢!