Mercurial > dive4elements > river
changeset 7736:714fda61b006
Server side validation for flys/issue1549.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 23 Jan 2014 17:48:55 +0100 (2014-01-23) |
parents | 46273d890da5 |
children | f4e32ac4e55c |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelGroundDifferences.java |
diffstat | 1 files changed, 13 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelGroundDifferences.java Wed Jan 22 13:26:35 2014 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelGroundDifferences.java Thu Jan 23 17:48:55 2014 +0100 @@ -161,5 +161,18 @@ throw new IllegalArgumentException("error_invalid_double_value"); } } + + @Override + protected boolean validateBounds( + double fromValid, double toValid, + double from, double to + ) throws IllegalArgumentException { + if (to < 0d) { + logger.error( + "Invalid 'to' " + to + " is lesser than zero."); + throw new IllegalArgumentException("error_feed_from_out_of_range"); + } + return super.validateBounds(fromValid, toValid, from, to); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :