public void fieldDisposed(DataModelField<ValueType> field) { for (FieldValidationRule<ValueType> rule : this.rules) { rule.fieldDisposed(field); } this.fieldsToValidate.remove(field); }
public Collection<String> runValidation(DataModel model) { Collection<String> errorMessages = new ArrayList<String>(); for (DataModelField<ValueType> field : this.fieldsToValidate) { String errorHeader = String.format( "(%s%s, %s): ", this.baseFieldName, field.getName(), field.getValue().toString()); for (FieldValidationRule<ValueType> rule : this.rules) { try { rule.validateField(field, model); } catch (ModelValidationException e) { String errorMessage = errorHeader + e.getMessage(); errorMessages.add(errorMessage); } } } return errorMessages; }
public void fieldsUpdated(Collection<DataModelField<ValueType>> fields) { for (FieldValidationRule<ValueType> rule : this.rules) { rule.fieldsUpdated(fields); } }
public void fieldUpdated(DataModelField<ValueType> field) { for (FieldValidationRule<ValueType> rule : this.rules) { rule.fieldUpdated(field); } }