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 NonZeroLengthConstraint extends ConstraintUtils 52 implements Constraint { 53 54 57 public NonZeroLengthConstraint() { 58 } 59 60 61 74 public Collection match(String value, String name) { 75 Collection failed_constrained_list = new ArrayList (); 76 if (value != null){ 77 if(value.length() == 0){ 78 String failureMessage = formatFailureMessage(toString(), name); 79 failed_constrained_list.add(new ConstraintFailure(toString(), 80 value, name, failureMessage, BundleReader.getValue( 81 "MSG_NonZeroLengthConstraint_Failure"))); } 83 } 84 return failed_constrained_list; 85 } 86 } 87 | Popular Tags |