1 23 24 package com.sun.enterprise.tools.common.validation.constraints; 25 26 import java.util.ArrayList ; 27 import java.util.Collection ; 28 29 import com.sun.enterprise.tools.common.validation.constraints.ConstraintFailure; 30 import com.sun.enterprise.tools.common.validation.util.BundleReader; 31 32 46 public class NonBlankConstraint extends ConstraintUtils 47 implements Constraint { 48 49 50 public NonBlankConstraint() { 51 } 52 53 54 67 public Collection match(String value, String name) { 68 Collection failed_constrained_list = new ArrayList (); 69 if((value != null) && (value.length() != 0)) { 70 value = value.trim(); 71 if(value.length() == 0){ 72 String failureMessage = formatFailureMessage(toString(), name); 73 failed_constrained_list.add(new ConstraintFailure(toString(), 74 value, name, failureMessage, BundleReader.getValue( 75 "MSG_NonBlankConstraint_Failure"))); } 77 } 78 return failed_constrained_list; 79 } 80 } 81 | Popular Tags |