I have a problem:
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;
}
}
The superclass has to validate that the xx
attribute cannot be null, but in the subclass, it's possible to have a null value. Is there any solution?