Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java @ 785:e764cab8c885
Save the relation between selected measurement and the parameter it belongs to (issue210). TODO: Adapt sql statements.
gnv-artifacts/trunk@867 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 30 Mar 2010 14:05:22 +0000 |
parents | 7b81d563c8c0 |
children | 6cd8492019d8 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Tue Mar 30 09:17:53 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Tue Mar 30 14:05:22 2010 +0000 @@ -19,6 +19,7 @@ /** * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> * */ public class InputValidator { @@ -37,7 +38,7 @@ super(); } - public boolean isInputValid(String minInput, String maxInput, String type) { + public static boolean isInputValid(String minInput, String maxInput, String type) { log.debug("InputValidator.isInputValid " + minInput + " " + maxInput + " " +type); boolean returnValue = false; if ("Date".equalsIgnoreCase(type)) { @@ -62,7 +63,7 @@ return returnValue; } - public boolean isInputValid(String input, String type) { + public static boolean isInputValid(String input, String type) { log.debug("InputValidator.isInputValid " + input + " " + type); boolean returnValue = false; String[] values = input.split(","); @@ -95,7 +96,7 @@ // REGEXP } else if ("Coordinate".equalsIgnoreCase(type)) { try { - valid = this.getPointValue(values[i]) != null; + valid = getPointValue(values[i]) != null; } catch (ValidationException e) { log.debug(e.getMessage()); valid = false; @@ -115,7 +116,7 @@ } - public Point getPointValue(String value) throws ValidationException{ + public static Point getPointValue(String value) throws ValidationException{ log.debug("InputValidator.getPointValue " + value); if (value.toLowerCase().startsWith("point")){ @@ -164,7 +165,7 @@ } - public boolean isDateValid(Date tmp, Date lo, Date up) { + public static boolean isDateValid(Date tmp, Date lo, Date up) { // we need to transform the given dates into seconds, because // they differ in milliseconds -> that's why we cannot use the // Date.compareTo(Date) method.