Explicit Validation with Direct Calls
The main usage of the ValidationService is for intercepting and validating models that are being saved. However, it is also possible to call the ValidationService directly.
All validation methods allow one to validate a Model or POJO class.
Following POJOs are used for a demonstration:
SamplePOJO.java
class SamplePOJO
{
private String value1;
private String value2;
public void setValue1(final String value){
this.value1 = value;
}
public String getValue1(){
return value1;
}
public void setValue2(final String value){
this.value2 = value;
}
public String getValue2(){
return value2;
}
}