| 1 package dinamica.validators; 2 3 import java.util.HashMap ; 4 import javax.servlet.http.HttpServletRequest ; 5 import dinamica.*; 6 7 26 public class UpperCaseTransformer extends AbstractValidator 27 { 28 29 32 public boolean isValid(HttpServletRequest req, Recordset inputParams, 33 HashMap attribs) throws Throwable  34 { 35 36 boolean bParam = attribs.containsKey("parameter"); 37 if (!bParam) 38 throw new Throwable ("[" + this.getClass().getName() + "] Missing attribute [parameter] in validator.xml"); 39 40 String paramName = (String )attribs.get("parameter"); 41 if (!inputParams.isNull(paramName)) 42 { 43 String value = inputParams.getString(paramName); 44 value = value.toUpperCase(); 45 inputParams.setValue(paramName, value); 46 } 47 48 return true; 49 50 } 51 52 } 53 | Popular Tags |