1 23 24 28 29 package com.sun.enterprise.tools.common.validation.constraints; 30 31 import java.util.ArrayList ; 32 import java.util.Collection ; 33 34 import com.sun.enterprise.tools.common.validation.constraints.ConstraintFailure; 35 import com.sun.enterprise.tools.common.validation.util.BundleReader; 36 37 51 public class MandatoryConstraint extends ConstraintUtils 52 implements Constraint{ 53 54 55 public MandatoryConstraint() { 56 } 57 58 59 71 public Collection match(String value, String name) { 72 return match((Object )value, name); 73 } 74 75 76 88 public java.util.Collection match(Object value, String name) { 89 Collection failed_constrained_list = new ArrayList (); 90 if (null == value){ 91 String failureMessage = formatFailureMessage(toString(), name); 92 failed_constrained_list.add(new ConstraintFailure(toString(), value, 93 name, failureMessage, BundleReader.getValue( 94 "MSG_MandatoryConstraint_Failure"))); } 96 return failed_constrained_list; 97 } 98 } 99 | Popular Tags |