use of org.openforis.idm.metamodel.validation.ValidationResult in project collect by openforis.
the class CollectValidator method adjustErrorsForEntryPhase.
private ValidationResults adjustErrorsForEntryPhase(ValidationResults results, Attribute<?, ?> attribute) {
boolean confirmed = isErrorConfirmed(attribute);
ValidationResults phaseEntryResults = new ValidationResults();
List<ValidationResult> errors = results.getErrors();
for (ValidationResult error : errors) {
ValidationResultFlag newFlag = confirmed ? ValidationResultFlag.WARNING : ValidationResultFlag.ERROR;
phaseEntryResults.addResult(error.getValidator(), newFlag);
}
phaseEntryResults.addResults(results.getWarnings());
return phaseEntryResults;
}
Aggregations