1 19 20 package org.netbeans.modules.j2ee.sun.validation.constraints; 21 22 import java.util.ArrayList ; 23 import java.util.Collection ; 24 25 import org.netbeans.modules.j2ee.sun.validation.constraints.ConstraintFailure; 26 import org.netbeans.modules.j2ee.sun.validation.util.BundleReader; 27 28 42 public class NonZeroLengthConstraint extends ConstraintUtils 43 implements Constraint { 44 45 48 public NonZeroLengthConstraint() { 49 } 50 51 52 65 public Collection match(String value, String name) { 66 Collection failed_constrained_list = new ArrayList (); 67 if (value != null){ 68 if(value.length() == 0){ 69 String failureMessage = formatFailureMessage(toString(), name); 70 failed_constrained_list.add(new ConstraintFailure(toString(), 71 value, name, failureMessage, BundleReader.getValue( 72 "MSG_NonZeroLengthConstraint_Failure"))); } 74 } 75 return failed_constrained_list; 76 } 77 } 78 | Popular Tags |