comparison gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java @ 111:065ec0a29394

Integrate the type Point into the ArtifactMethod. Integrate Responstest for feed-Requests into the JUnitTest gnv-artifacts/trunk@160 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 29 Sep 2009 15:30:03 +0000
parents 5e086156e3d1
children a16f5267803e
comparison
equal deleted inserted replaced
110:b465f1bbe368 111:065ec0a29394
31 for (int i = 0; i < values.length; i++){ 31 for (int i = 0; i < values.length; i++){
32 boolean valid; 32 boolean valid;
33 if ("Integer".equalsIgnoreCase(type)){ 33 if ("Integer".equalsIgnoreCase(type)){
34 valid = org.apache.commons.validator.GenericValidator.isInt(values[i].trim()); 34 valid = org.apache.commons.validator.GenericValidator.isInt(values[i].trim());
35 }else if ("String".equalsIgnoreCase(type)){ 35 }else if ("String".equalsIgnoreCase(type)){
36 valid = org.apache.commons.validator.GenericValidator.matchRegexp(values[i], "[a-zA-Z0-9]"); 36 valid = org.apache.commons.validator.GenericValidator.matchRegexp(values[i], "[a-zA-Z0-9]"); // TODO: FIXME: VALIDATE REGEXP
37 }else if ("Date".equalsIgnoreCase(type)){ 37 }else if ("Date".equalsIgnoreCase(type)){
38 valid = org.apache.commons.validator.GenericValidator.isDate(values[i].trim(), DateUtils.DATE_PATTERN, true); 38 valid = org.apache.commons.validator.GenericValidator.isDate(values[i].trim(), DateUtils.DATE_PATTERN, true);
39 }else if ("Point".equalsIgnoreCase(type)){
40 valid = org.apache.commons.validator.GenericValidator.matchRegexp(values[i], "[0-9]"); // TODO: FIXME: VALIDATE REGEXP
39 }else{ 41 }else{
40 valid = false; 42 valid = false;
41 } 43 }
42 if (!valid){ 44 if (!valid){
43 returnValue = false; 45 returnValue = false;

http://dive4elements.wald.intevation.org