support double value validation

This commit is contained in:
Andreas Billmann
2015-12-17 23:55:08 +01:00
parent a67937a262
commit a5435c6b5f
4 changed files with 15 additions and 0 deletions

View File

@@ -96,6 +96,7 @@ public class Validator {
checkInteger(columnConfig, value, error);
checkGroovy(column, columnConfig, value, error);
checkValueOf(columnConfig, value, error);
checkDouble(columnConfig, value, error);
}
if (!error.isEmpty()) {
@@ -174,6 +175,15 @@ public class Validator {
}
}
private void checkDouble(Config columnConfig, String value, ValidationError error) {
if (getBoolean(columnConfig, "double")) {
if (!isDouble(value)) {
error.add("validation.message.double");
}
}
}
private void checkMinLength(Config columnConfig, String value, ValidationError error) {
Integer minLength = getInteger(columnConfig, "minlength");
if (minLength != null) {