1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 01:36:18 +00:00

#65: Vocabulary resource

This commit is contained in:
jendib
2016-02-14 21:00:21 +01:00
parent d3a74ed361
commit 98497f2a37
9 changed files with 546 additions and 283 deletions

View File

@@ -143,6 +143,12 @@ public class ValidationUtil {
}
}
public static void validateRegex(String s, String name, String regex) throws ClientException {
if (!Pattern.compile(regex).matcher(s).matches()) {
throw new ClientException("ValidationError", MessageFormat.format("{0} must match {1}", name, regex));
}
}
/**
* Checks if the string is a number.
*