1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.student.r2.common.datadictionary.dto; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import javax.xml.bind.annotation.XmlAccessType; |
21 | |
import javax.xml.bind.annotation.XmlAccessorType; |
22 | |
import javax.xml.bind.annotation.XmlElement; |
23 | |
import org.kuali.rice.core.api.uif.DataType; |
24 | |
import org.kuali.student.r2.common.datadictionary.infc.AttributeDefinitionInfc; |
25 | |
import org.kuali.student.r2.common.datadictionary.infc.ValidCharactersConstraintInfc; |
26 | |
|
27 | 0 | @XmlAccessorType(XmlAccessType.FIELD) |
28 | |
public class AttributeDefinitionInfo |
29 | |
implements AttributeDefinitionInfc, Serializable { |
30 | |
|
31 | |
private static final long serialVersionUID = 1L; |
32 | |
|
33 | |
@XmlElement |
34 | |
private String name; |
35 | |
|
36 | |
@XmlElement |
37 | |
private String childEntryName; |
38 | |
|
39 | |
@XmlElement |
40 | |
private DataType dataType; |
41 | |
|
42 | |
@XmlElement |
43 | |
private Boolean isRequired; |
44 | |
|
45 | |
@XmlElement |
46 | |
private Integer minOccurs; |
47 | |
|
48 | |
@XmlElement |
49 | |
private Integer maxOccurs; |
50 | |
|
51 | |
@XmlElement |
52 | |
private Integer minLength; |
53 | |
|
54 | |
@XmlElement |
55 | |
private Integer maxLength; |
56 | |
|
57 | |
@XmlElement |
58 | |
private Boolean isForceUppercase; |
59 | |
|
60 | |
@XmlElement |
61 | |
private String shortLabel; |
62 | |
|
63 | |
@XmlElement |
64 | |
private String summary; |
65 | |
|
66 | |
@XmlElement |
67 | |
private String label; |
68 | |
|
69 | |
@XmlElement |
70 | |
private String description; |
71 | |
|
72 | |
@XmlElement |
73 | |
private String exclusiveMin; |
74 | |
|
75 | |
@XmlElement |
76 | |
private String inclusiveMax; |
77 | |
|
78 | |
@XmlElement |
79 | |
private String displayLabelAttribute; |
80 | |
|
81 | |
@XmlElement |
82 | |
private Boolean isUnique; |
83 | |
|
84 | |
@XmlElement |
85 | |
private String customValidatorClass; |
86 | |
|
87 | |
@XmlElement |
88 | |
private String formatterClass; |
89 | |
|
90 | |
@XmlElement |
91 | |
private ValidCharactersConstraintInfo validCharactersConstraint; |
92 | |
|
93 | |
|
94 | |
|
95 | |
|
96 | |
|
97 | 0 | public AttributeDefinitionInfo() { |
98 | 0 | } |
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | |
|
104 | |
|
105 | |
|
106 | 0 | public AttributeDefinitionInfo(AttributeDefinitionInfc attrDef) { |
107 | |
|
108 | 0 | if (attrDef != null) { |
109 | 0 | this.name = attrDef.getName(); |
110 | 0 | this.childEntryName = attrDef.getChildEntryName(); |
111 | 0 | this.dataType = attrDef.getDataType(); |
112 | 0 | this.isRequired = attrDef.getIsRequired(); |
113 | 0 | this.minOccurs = attrDef.getMinOccurs(); |
114 | 0 | this.maxOccurs = attrDef.getMaxOccurs(); |
115 | 0 | this.minLength = attrDef.getMinLength(); |
116 | 0 | this.maxLength = attrDef.getMaxLength(); |
117 | 0 | this.isForceUppercase = attrDef.getIsForceUppercase(); |
118 | 0 | this.shortLabel = attrDef.getShortLabel(); |
119 | 0 | this.summary = attrDef.getSummary(); |
120 | 0 | this.label = attrDef.getLabel(); |
121 | 0 | this.description = attrDef.getDescription(); |
122 | 0 | this.exclusiveMin = attrDef.getExclusiveMin(); |
123 | 0 | this.inclusiveMax = attrDef.getInclusiveMax(); |
124 | 0 | this.displayLabelAttribute = attrDef.getDisplayLabelAttribute(); |
125 | 0 | this.isUnique = attrDef.getIsUnique(); |
126 | 0 | this.customValidatorClass = attrDef.getCustomValidatorClass(); |
127 | 0 | this.formatterClass = attrDef.getFormatterClass(); |
128 | 0 | if (attrDef.getValidCharactersConstraint() != null) { |
129 | 0 | this.validCharactersConstraint = new ValidCharactersConstraintInfo.Builder(attrDef.getValidCharactersConstraint()).build(); |
130 | |
} |
131 | |
} |
132 | 0 | } |
133 | |
|
134 | |
@Override |
135 | |
public String getName() { |
136 | 0 | return this.name; |
137 | |
} |
138 | |
|
139 | |
@Override |
140 | |
public String getChildEntryName() { |
141 | 0 | return this.childEntryName; |
142 | |
} |
143 | |
|
144 | |
@Override |
145 | |
public DataType getDataType() { |
146 | 0 | return this.dataType; |
147 | |
} |
148 | |
|
149 | |
@Override |
150 | |
public Boolean getIsRequired() { |
151 | 0 | return this.isRequired; |
152 | |
} |
153 | |
|
154 | |
@Override |
155 | |
public Integer getMinOccurs() { |
156 | 0 | return this.minOccurs; |
157 | |
} |
158 | |
|
159 | |
@Override |
160 | |
public Integer getMaxOccurs() { |
161 | 0 | return this.maxOccurs; |
162 | |
} |
163 | |
|
164 | |
@Override |
165 | |
public Integer getMinLength() { |
166 | 0 | return this.minLength; |
167 | |
} |
168 | |
|
169 | |
@Override |
170 | |
public Integer getMaxLength() { |
171 | 0 | return this.maxLength; |
172 | |
} |
173 | |
|
174 | |
@Override |
175 | |
public Boolean getIsForceUppercase() { |
176 | 0 | return this.isForceUppercase; |
177 | |
} |
178 | |
|
179 | |
@Override |
180 | |
public String getShortLabel() { |
181 | 0 | return this.shortLabel; |
182 | |
} |
183 | |
|
184 | |
@Override |
185 | |
public String getSummary() { |
186 | 0 | return this.summary; |
187 | |
} |
188 | |
|
189 | |
@Override |
190 | |
public String getLabel() { |
191 | 0 | return this.label; |
192 | |
} |
193 | |
|
194 | |
@Override |
195 | |
public String getDescription() { |
196 | 0 | return this.description; |
197 | |
} |
198 | |
|
199 | |
@Override |
200 | |
public String getExclusiveMin() { |
201 | 0 | return this.exclusiveMin; |
202 | |
} |
203 | |
|
204 | |
@Override |
205 | |
public String getInclusiveMax() { |
206 | 0 | return this.inclusiveMax; |
207 | |
} |
208 | |
|
209 | |
@Override |
210 | |
public String getDisplayLabelAttribute() { |
211 | 0 | return this.displayLabelAttribute; |
212 | |
} |
213 | |
|
214 | |
@Override |
215 | |
public Boolean getIsUnique() { |
216 | 0 | return this.isUnique; |
217 | |
} |
218 | |
|
219 | |
@Override |
220 | |
public String getCustomValidatorClass() { |
221 | 0 | return this.customValidatorClass; |
222 | |
} |
223 | |
|
224 | |
@Override |
225 | |
public String getFormatterClass() { |
226 | 0 | return this.formatterClass; |
227 | |
} |
228 | |
|
229 | |
@Override |
230 | |
public ValidCharactersConstraintInfo getValidCharactersConstraint() { |
231 | 0 | return this.validCharactersConstraint; |
232 | |
} |
233 | |
|
234 | |
|
235 | |
public static class Builder implements AttributeDefinitionInfc { |
236 | |
|
237 | |
private String name; |
238 | |
private String childEntryName; |
239 | |
private DataType dataType; |
240 | |
private Boolean required; |
241 | |
private Integer minOccurs; |
242 | |
private Integer maxOccurs; |
243 | |
private Integer minLength; |
244 | |
private Integer maxLength; |
245 | |
private Boolean forceUppercase; |
246 | |
private String shortLabel; |
247 | |
private String summary; |
248 | |
private String label; |
249 | |
private String description; |
250 | |
private String exclusiveMin; |
251 | |
private String inclusiveMax; |
252 | |
private String displayLabelAttribute; |
253 | |
private Boolean unique; |
254 | |
private String customValidatorClass; |
255 | |
private String formatterClass; |
256 | |
private ValidCharactersConstraintInfc validCharactersConstraint; |
257 | |
|
258 | 0 | public Builder() { |
259 | 0 | } |
260 | |
|
261 | 0 | public Builder(AttributeDefinitionInfc attrDef) { |
262 | 0 | this.name = attrDef.getName(); |
263 | 0 | this.childEntryName = attrDef.getChildEntryName(); |
264 | 0 | this.dataType = attrDef.getDataType(); |
265 | 0 | this.required = attrDef.getIsRequired(); |
266 | 0 | this.minOccurs = attrDef.getMinOccurs(); |
267 | 0 | this.maxOccurs = attrDef.getMaxOccurs(); |
268 | 0 | this.minLength = attrDef.getMinLength(); |
269 | 0 | this.maxLength = attrDef.getMaxLength(); |
270 | 0 | this.forceUppercase = attrDef.getIsForceUppercase(); |
271 | 0 | this.shortLabel = attrDef.getShortLabel(); |
272 | 0 | this.summary = attrDef.getSummary(); |
273 | 0 | this.label = attrDef.getLabel(); |
274 | 0 | this.description = attrDef.getDescription(); |
275 | 0 | this.exclusiveMin = attrDef.getExclusiveMin(); |
276 | 0 | this.inclusiveMax = attrDef.getInclusiveMax(); |
277 | 0 | this.displayLabelAttribute = attrDef.getDisplayLabelAttribute(); |
278 | 0 | this.unique = attrDef.getIsUnique(); |
279 | 0 | this.customValidatorClass = attrDef.getCustomValidatorClass(); |
280 | 0 | this.formatterClass = attrDef.getFormatterClass(); |
281 | 0 | this.validCharactersConstraint = attrDef.getValidCharactersConstraint(); |
282 | 0 | } |
283 | |
|
284 | |
public AttributeDefinitionInfo build() { |
285 | 0 | return new AttributeDefinitionInfo(this); |
286 | |
} |
287 | |
|
288 | |
@Override |
289 | |
public String getChildEntryName() { |
290 | 0 | return this.childEntryName; |
291 | |
} |
292 | |
|
293 | |
@Override |
294 | |
public String getCustomValidatorClass() { |
295 | 0 | return this.customValidatorClass; |
296 | |
} |
297 | |
|
298 | |
@Override |
299 | |
public DataType getDataType() { |
300 | 0 | return this.dataType; |
301 | |
} |
302 | |
|
303 | |
@Override |
304 | |
public String getDescription() { |
305 | 0 | return this.description; |
306 | |
} |
307 | |
|
308 | |
@Override |
309 | |
public String getDisplayLabelAttribute() { |
310 | 0 | return this.displayLabelAttribute; |
311 | |
} |
312 | |
|
313 | |
@Override |
314 | |
public String getExclusiveMin() { |
315 | 0 | return this.exclusiveMin; |
316 | |
} |
317 | |
|
318 | |
@Override |
319 | |
public Boolean getIsForceUppercase() { |
320 | 0 | return this.forceUppercase; |
321 | |
} |
322 | |
|
323 | |
@Override |
324 | |
public String getFormatterClass() { |
325 | 0 | return this.formatterClass; |
326 | |
} |
327 | |
|
328 | |
@Override |
329 | |
public String getInclusiveMax() { |
330 | 0 | return this.inclusiveMax; |
331 | |
} |
332 | |
|
333 | |
@Override |
334 | |
public String getLabel() { |
335 | 0 | return this.label; |
336 | |
} |
337 | |
|
338 | |
@Override |
339 | |
public Integer getMaxLength() { |
340 | 0 | return this.maxLength; |
341 | |
} |
342 | |
|
343 | |
@Override |
344 | |
public Integer getMaxOccurs() { |
345 | 0 | return this.maxOccurs; |
346 | |
} |
347 | |
|
348 | |
@Override |
349 | |
public Integer getMinLength() { |
350 | 0 | return this.minLength; |
351 | |
} |
352 | |
|
353 | |
@Override |
354 | |
public Integer getMinOccurs() { |
355 | 0 | return this.minOccurs; |
356 | |
} |
357 | |
|
358 | |
@Override |
359 | |
public String getName() { |
360 | 0 | return this.name; |
361 | |
} |
362 | |
|
363 | |
@Override |
364 | |
public String getShortLabel() { |
365 | 0 | return this.shortLabel; |
366 | |
} |
367 | |
|
368 | |
@Override |
369 | |
public String getSummary() { |
370 | 0 | return this.summary; |
371 | |
} |
372 | |
|
373 | |
@Override |
374 | |
public Boolean getIsUnique() { |
375 | 0 | return this.unique; |
376 | |
} |
377 | |
|
378 | |
@Override |
379 | |
public ValidCharactersConstraintInfc getValidCharactersConstraint() { |
380 | 0 | return this.validCharactersConstraint; |
381 | |
} |
382 | |
|
383 | |
@Override |
384 | |
public Boolean getIsRequired() { |
385 | 0 | return this.required; |
386 | |
} |
387 | |
|
388 | |
public Builder setChildEntryName(String childEntryName) { |
389 | 0 | this.childEntryName = childEntryName; |
390 | 0 | return this; |
391 | |
} |
392 | |
|
393 | |
public Builder setCustomValidatorClass(String customValidatorClass) { |
394 | 0 | this.customValidatorClass = customValidatorClass; |
395 | 0 | return this; |
396 | |
} |
397 | |
|
398 | |
public Builder setDataType(DataType dataType) { |
399 | 0 | this.dataType = dataType; |
400 | 0 | return this; |
401 | |
} |
402 | |
|
403 | |
public Builder setDescription(String description) { |
404 | 0 | this.description = description; |
405 | 0 | return this; |
406 | |
} |
407 | |
|
408 | |
public Builder setDisplayLabelAttribute(String displayLabelAttribute) { |
409 | 0 | this.displayLabelAttribute = displayLabelAttribute; |
410 | 0 | return this; |
411 | |
} |
412 | |
|
413 | |
public Builder setExclusiveMin(String exclusiveMin) { |
414 | 0 | this.exclusiveMin = exclusiveMin; |
415 | 0 | return this; |
416 | |
} |
417 | |
|
418 | |
public Builder setForceUppercase(Boolean forceUppercase) { |
419 | 0 | this.forceUppercase = forceUppercase; |
420 | 0 | return this; |
421 | |
} |
422 | |
|
423 | |
public Builder setFormatterClass(String formatterClass) { |
424 | 0 | this.formatterClass = formatterClass; |
425 | 0 | return this; |
426 | |
} |
427 | |
|
428 | |
public Builder setInclusiveMax(String inclusiveMax) { |
429 | 0 | this.inclusiveMax = inclusiveMax; |
430 | 0 | return this; |
431 | |
} |
432 | |
|
433 | |
public Builder setLabel(String label) { |
434 | 0 | this.label = label; |
435 | 0 | return this; |
436 | |
} |
437 | |
|
438 | |
public Builder setMaxLength(Integer maxLength) { |
439 | 0 | this.maxLength = maxLength; |
440 | 0 | return this; |
441 | |
} |
442 | |
|
443 | |
public Builder setMaxOccurs(Integer maxOccurs) { |
444 | 0 | this.maxOccurs = maxOccurs; |
445 | 0 | return this; |
446 | |
} |
447 | |
|
448 | |
public Builder setMinLength(Integer minLength) { |
449 | 0 | this.minLength = minLength; |
450 | 0 | return this; |
451 | |
} |
452 | |
|
453 | |
public Builder setMinOccurs(Integer minOccurs) { |
454 | 0 | this.minOccurs = minOccurs; |
455 | 0 | return this; |
456 | |
} |
457 | |
|
458 | |
public Builder setName(String name) { |
459 | 0 | this.name = name; |
460 | 0 | return this; |
461 | |
} |
462 | |
|
463 | |
public Builder setRequired(Boolean required) { |
464 | 0 | this.required = required; |
465 | 0 | return this; |
466 | |
} |
467 | |
|
468 | |
public Builder setShortLabel(String shortLabel) { |
469 | 0 | this.shortLabel = shortLabel; |
470 | 0 | return this; |
471 | |
} |
472 | |
|
473 | |
public Builder setSummary(String summary) { |
474 | 0 | this.summary = summary; |
475 | 0 | return this; |
476 | |
} |
477 | |
|
478 | |
public Builder setUnique(Boolean unique) { |
479 | 0 | this.unique = unique; |
480 | 0 | return this; |
481 | |
} |
482 | |
|
483 | |
public Builder setValidCharactersConstraint(ValidCharactersConstraintInfc validCharactersConstraint) { |
484 | 0 | this.validCharactersConstraint = validCharactersConstraint; |
485 | 0 | return this; |
486 | |
} |
487 | |
} |
488 | |
} |