View Javadoc

1   /**
2    * Copyright 2005-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.datadictionary.validation.constraint;
17  
18  import javax.xml.bind.annotation.XmlAccessType;
19  import javax.xml.bind.annotation.XmlAccessorType;
20  import javax.xml.bind.annotation.XmlElement;
21  import java.util.List;
22  
23  /**
24   * A case constraint is a constraint that is imposed only when a certain condition is met, for example, if the country attribute value is "USA",
25   * then a prerequisite constraint may be imposed that the 'State' attribute is non-null. 
26   * 
27   * This class is a direct copy of one that was in Kuali Student. 
28   * 
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   * @since 1.1
31   */
32  @XmlAccessorType(XmlAccessType.FIELD)
33  public class CaseConstraint extends BaseConstraint {
34  	@XmlElement
35      protected List<WhenConstraint> whenConstraint;
36  	@XmlElement
37  	protected String propertyName;
38  	@XmlElement
39  	protected String operator;
40  	@XmlElement
41  	protected boolean caseSensitive;
42  
43  	public List<WhenConstraint> getWhenConstraint() {
44  		return whenConstraint;
45  	}
46  
47  	public void setWhenConstraint(List<WhenConstraint> whenConstraint) {
48  		this.whenConstraint = whenConstraint;
49  	}
50  
51  	public String getPropertyName() {
52  		return propertyName;
53  	}
54  
55  	public void setPropertyName(String propertyName) {
56  		this.propertyName = propertyName;
57  	}
58  
59  	public String getOperator() {
60  		return operator;
61  	}
62  
63  	public void setOperator(String operator) {
64  		this.operator = operator;
65  	}
66  
67      public boolean isCaseSensitive() {
68          return caseSensitive;
69      }
70  
71      public void setCaseSensitive(boolean caseSensitive) {
72          this.caseSensitive = caseSensitive;
73      }
74  }