use of org.eclipse.xtext.validation.AbstractDeclarativeValidator in project ow by vtst.
the class ValidatorPageHelper method getValidator.
/**
* @return The validator configured by the property page.
* The default package looks for an AbstractDeclarativeValidator associated with the package.
*/
protected AbstractDeclarativeValidator getValidator() {
if (ePackage == null) {
showErrorMessageDuringInit("EPackage not injected");
return null;
}
EValidator validator = eValidatorRegistry.getEValidator(ePackage);
if (validator == null) {
showErrorMessageDuringInit("No validator found for the current package");
return null;
}
ArrayList<AbstractDeclarativeValidator> declarativeValidators = new ArrayList<AbstractDeclarativeValidator>(1);
getValidatorRec(validator, declarativeValidators);
if (declarativeValidators.size() != 1) {
showErrorMessageDuringInit("Found the following declarative validators: ");
for (AbstractDeclarativeValidator v : declarativeValidators) showErrorMessageDuringInit(v.getClass().getName());
return null;
}
return declarativeValidators.get(0);
}
Aggregations