Coverage Report - org.kuali.rice.kns.datadictionary.validation.constraint.WhenConstraint
 
Classes in this File Line Coverage Branch Coverage Complexity
WhenConstraint
0%
0/13
N/A
1
 
 1  
 package org.kuali.rice.kns.datadictionary.validation.constraint;
 2  
 
 3  
 import java.util.ArrayList;
 4  
 import java.util.List;
 5  
 
 6  
 import javax.xml.bind.annotation.XmlAccessType;
 7  
 import javax.xml.bind.annotation.XmlAccessorType;
 8  
 
 9  
 /**
 10  
  * A when constraint is a child of a case constraint. It provides a specific additional constraint that should be processed when 
 11  
  * the condition itself is true. 
 12  
  * 
 13  
  * So a case constraint on country, might have a when constraint with value='USA', and another with value='Canada'. Each of these
 14  
  * when constraints would define a constraint of their own that would only be processed when the country was USA, or when the country 
 15  
  * was Canada. 
 16  
  * 
 17  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 18  
  * @since 1.1
 19  
  */
 20  
 @XmlAccessorType(XmlAccessType.FIELD)
 21  0
 public class WhenConstraint implements Constraint {
 22  
         protected List<Object> values;
 23  
         protected String valuePath;
 24  
         protected Constraint constraint;
 25  
 
 26  
         public List<Object> getValues() {
 27  0
                 return values;
 28  
         }
 29  
 
 30  
         public void setValues(List<Object> values) {
 31  0
         this.values = values;
 32  0
     }
 33  
 
 34  
     public void setValue(Object value) {            
 35  0
             values = new ArrayList<Object>();
 36  0
             values.add(value);
 37  0
         }
 38  
 
 39  
         public String getValuePath() {
 40  0
                 return valuePath;
 41  
         }
 42  
 
 43  
         public void setValuePath(String valuePath) {
 44  0
                 this.valuePath = valuePath;
 45  0
         }
 46  
 
 47  
         public Constraint getConstraint() {
 48  0
                 return constraint;
 49  
         }
 50  
 
 51  
         public void setConstraint(Constraint constraint) {
 52  0
                 this.constraint = constraint;
 53  0
         }
 54  
 }