1 19 20 package org.netbeans.modules.j2ee.sun.validation.constraints; 21 22 import java.util.ArrayList ; 23 import java.util.Collection ; 24 25 44 public class AndConstraint extends ConstraintUtils implements Constraint { 45 46 51 private Constraint leftConstraint = null; 52 53 54 59 private Constraint rightConstraint = null; 60 61 62 63 public AndConstraint() { 64 Constraint leftConstraint = null; 65 Constraint rightConstraint = null; 66 } 67 68 69 70 public AndConstraint(Constraint leftConstraint, 71 Constraint rightConstraint){ 72 this.leftConstraint = leftConstraint; 73 this.rightConstraint = rightConstraint; 74 } 75 76 77 89 public Collection match(String value, String name) { 90 Collection failed_constrained_list = new ArrayList (); 91 failed_constrained_list.addAll(leftConstraint.match(value, name)); 92 failed_constrained_list.addAll(rightConstraint.match(value, name)); 93 return failed_constrained_list; 94 } 95 96 97 104 public void setLeftConstraint(Constraint constraint){ 105 leftConstraint = constraint; 106 } 107 108 109 116 public void setRightConstraint(Constraint constraint){ 117 rightConstraint = constraint; 118 } 119 120 121 124 public void print() { 125 super.print(); 126 ((ConstraintUtils)leftConstraint).print(); 127 ((ConstraintUtils)rightConstraint).print(); 128 } 129 } 130 | Popular Tags |