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 MandatoryConstraint extends ConstraintUtils 43 implements Constraint{ 44 45 46 public MandatoryConstraint() { 47 } 48 49 50 62 public Collection match(String value, String name) { 63 return match((Object )value, name); 64 } 65 66 67 79 public java.util.Collection match(Object value, String name) { 80 Collection failed_constrained_list = new ArrayList (); 81 if (null == value){ 82 String failureMessage = formatFailureMessage(toString(), name); 83 failed_constrained_list.add(new ConstraintFailure(toString(), value, 84 name, failureMessage, BundleReader.getValue( 85 "MSG_MandatoryConstraint_Failure"))); } 87 return failed_constrained_list; 88 } 89 } 90 | Popular Tags |