View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.common.assembly.data;
17  
18  import java.io.Serializable;
19  import java.util.List;
20  
21  import javax.xml.bind.annotation.XmlAccessType;
22  import javax.xml.bind.annotation.XmlAccessorType;
23  import javax.xml.bind.annotation.XmlTransient;
24  
25  /**
26   * 
27   * @author nwright
28   */
29  @XmlAccessorType(XmlAccessType.FIELD)
30  public class ConstraintMetadata implements Serializable {
31  
32  	private static final long serialVersionUID = 1L;
33  
34  	@XmlTransient
35  	private List<ConstraintMetadata> childConstraints;
36  
37  	private String comments;
38  
39  	private String desc;
40  
41  	private String id;
42  
43  	private Integer maxLength;
44  
45  	private Integer maxOccurs;
46  
47  	private String maxValue;
48  
49  	private Integer minLength;
50  
51  	protected Integer minOccurs;
52  
53  	private String minValue;
54  
55  	private boolean serverSide;
56  
57  	protected String specialValidator;
58  
59  	private String validChars;
60  
61  	private String validCharsMessageId;
62  	
63  	private boolean requiredForNextState = false;
64  	
65  	private String nextState;
66  
67  	public List<ConstraintMetadata> getChildConstraints() {
68  		return childConstraints;
69  	}
70  
71  	public void setChildConstraints(List<ConstraintMetadata> childConstraints) {
72  		this.childConstraints = childConstraints;
73  	}
74  
75  	public String getComments() {
76  		return comments;
77  	}
78  
79  	public void setComments(String comments) {
80  		this.comments = comments;
81  	}
82  
83  	public String getDesc() {
84  		return desc;
85  	}
86  
87  	public void setDesc(String desc) {
88  		this.desc = desc;
89  	}
90  
91  	public String getId() {
92  		return id;
93  	}
94  
95  	public void setId(String id) {
96  		this.id = id;
97  	}
98  
99  	public Integer getMaxLength() {
100 		return maxLength;
101 	}
102 
103 	public void setMaxLength(Integer maxLength) {
104 		this.maxLength = maxLength;
105 	}
106 
107 	public Integer getMaxOccurs() {
108 		return maxOccurs;
109 	}
110 
111 	public void setMaxOccurs(Integer maxOccurs) {
112 		this.maxOccurs = maxOccurs;
113 	}
114 
115 	public String getMaxValue() {
116 		return maxValue;
117 	}
118 
119 	public void setMaxValue(String maxValue) {
120 		this.maxValue = maxValue;
121 	}
122 
123 	public Integer getMinLength() {
124 		return minLength;
125 	}
126 
127 	public void setMinLength(Integer minLength) {
128 		this.minLength = minLength;
129 	}
130 
131 	public Integer getMinOccurs() {
132 		return minOccurs;
133 	}
134 
135 	public void setMinOccurs(Integer minOccurs) {
136 		this.minOccurs = minOccurs;
137 	}
138 
139 	public String getMinValue() {
140 		return minValue;
141 	}
142 
143 	public void setMinValue(String minValue) {
144 		this.minValue = minValue;
145 	}
146 
147 	public boolean isServerSide() {
148 		return serverSide;
149 	}
150 
151 	public void setServerSide(boolean serverSide) {
152 		this.serverSide = serverSide;
153 	}
154 
155 	public String getSpecialValidator() {
156 		return specialValidator;
157 	}
158 
159 	public void setSpecialValidator(String specialValidator) {
160 		this.specialValidator = specialValidator;
161 	}
162 
163 	public String getValidChars() {
164 		return validChars;
165 	}
166 
167 	public void setValidChars(String validChars) {
168 		this.validChars = validChars;
169 	}
170 
171 	public String getValidCharsMessageId() {
172 		return validCharsMessageId;
173 	}
174 
175 	public void setValidCharsMessageId(String validCharsMessageId) {
176 		this.validCharsMessageId = validCharsMessageId;
177 	}
178 
179 	public boolean isRequiredForNextState() {
180 		return requiredForNextState;
181 	}
182 
183 	public void setRequiredForNextState(boolean requiredForNextState) {
184 		this.requiredForNextState = requiredForNextState;
185 	}
186 
187 	public String getNextState() {
188 		return nextState;
189 	}
190 
191 	public void setNextState(String nextState) {
192 		this.nextState = nextState;
193 	}	
194 	
195     @Override
196     public String toString() {
197         StringBuilder sb = new StringBuilder();
198         _toString(sb);
199         return sb.toString();
200     }
201     
202     protected void _toString(StringBuilder sb) {
203         sb.append("comments: ");
204         sb.append(comments);
205         sb.append(", desc: ");
206         sb.append(desc);
207         sb.append(", id: ");
208         sb.append(id);
209         sb.append(", maxLength: ");
210         sb.append(null != maxLength ? maxLength.toString() : "null");
211         sb.append(", maxOccurs: ");
212         sb.append(null != maxOccurs ? maxOccurs.toString() : "null");
213         sb.append(", maxValue: ");
214         sb.append(maxValue);
215         sb.append(", minLength: ");
216         sb.append(null != minLength ? minLength.toString() : "null");
217         sb.append(", minOccurs: ");
218         sb.append(null != minOccurs ? minOccurs.toString() : "null");
219         sb.append(", minValue: ");
220         sb.append(minValue);
221         sb.append(", serverSide: ");
222         sb.append(Boolean.toString(serverSide));
223         sb.append(", specialValidator: ");
224         sb.append(specialValidator);
225         sb.append(", validCharsMessageId: ");
226         sb.append(validCharsMessageId);
227         sb.append(", validChars: ");
228         sb.append(validChars);
229         sb.append(", requiredForNextState: ");
230         sb.append(Boolean.toString(requiredForNextState));
231         sb.append(", nextState: ");
232         sb.append(nextState);
233         sb.append(", ChildConstraints: {");
234         if (null != childConstraints) {
235             for (ConstraintMetadata constraint : childConstraints) {
236                 constraint._toString(sb);
237             }
238         }
239         sb.append("}");
240     }
241 }