我有问题:
public class hello{
protected String xx;
@NotEmpty
@JsonProperty("xx")
@JacksonXmlProperty(localName = "xx")
public String getXx() {
return xx;
}
public void setxx(String xx) {
this.xx= xx;
}
}
public class hi extends hello {
@Override
@Nullable
@JsonProperty("xx")
@JacksonXmlProperty(localName = "xx")
public String getXx() {
return xx;
}
@Override
public void setXx(String xx) {
this.xx = xx;
}
}
超类必须验证xx
属性不能为null,但是在子类中,可能具有null值。有什么解决办法吗?