1 package org.sapia.validator.rules; 2 3 import org.sapia.validator.BeanRule; 4 5 15 public class MandatoryString extends BeanRule { 16 19 public MandatoryString() { 20 super(); 21 } 22 23 26 protected boolean doValidate(Object toValidate) { 27 if(toValidate == null){ 28 return false; 29 } 30 else{ 31 return ((String )toValidate).length() > 0; 32 } 33 } 34 } 35 | Popular Tags |