use of org.camunda.bpm.engine.impl.form.validator.FormValidators in project camunda-bpm-platform by camunda.
the class ProcessEngineConfigurationImpl method initFormFieldValidators.
protected void initFormFieldValidators() {
if (formValidators == null) {
formValidators = new FormValidators();
formValidators.addValidator("min", MinValidator.class);
formValidators.addValidator("max", MaxValidator.class);
formValidators.addValidator("minlength", MinLengthValidator.class);
formValidators.addValidator("maxlength", MaxLengthValidator.class);
formValidators.addValidator("required", RequiredValidator.class);
formValidators.addValidator("readonly", ReadOnlyValidator.class);
}
if (customFormFieldValidators != null) {
for (Entry<String, Class<? extends FormFieldValidator>> validator : customFormFieldValidators.entrySet()) {
formValidators.addValidator(validator.getKey(), validator.getValue());
}
}
}
use of org.camunda.bpm.engine.impl.form.validator.FormValidators in project camunda-bpm-platform by camunda.
the class BuiltInValidatorsTest method testDefaultFormFieldValidators.
public void testDefaultFormFieldValidators() {
// assert default validators are registered
FormValidators formValidators = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getFormValidators();
Map<String, Class<? extends FormFieldValidator>> validators = formValidators.getValidators();
assertEquals(RequiredValidator.class, validators.get("required"));
assertEquals(ReadOnlyValidator.class, validators.get("readonly"));
assertEquals(MinValidator.class, validators.get("min"));
assertEquals(MaxValidator.class, validators.get("max"));
assertEquals(MaxLengthValidator.class, validators.get("maxlength"));
assertEquals(MinLengthValidator.class, validators.get("minlength"));
}
Aggregations