1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.r2.common.datadictionary;
17
18 import org.kuali.rice.krad.datadictionary.AttributeDefinition;
19 import org.kuali.student.r2.common.datadictionary.infc.AttributeDefinitionInfc;
20
21
22
23
24
25 public class Student2RiceAttributeDefinitionConverter {
26
27 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(Student2RiceAttributeDefinitionConverter.class);
28
29 public AttributeDefinition convert(AttributeDefinitionInfc student) {
30 AttributeDefinition rice = new AttributeDefinition();
31 rice.setName(student.getName());
32 rice.setChildEntryName(student.getChildEntryName());
33 rice.setDataType(student.getDataType());
34 rice.setRequired(student.getIsRequired());
35
36
37 rice.setMinLength(student.getMinLength());
38 rice.setMaxLength(student.getMaxLength());
39 rice.setForceUppercase(student.getIsForceUppercase());
40 rice.setShortLabel(student.getShortLabel());
41 rice.setSummary(student.getSummary());
42 rice.setLabel(student.getLabel());
43 rice.setDescription(student.getDescription());
44 rice.setExclusiveMin(student.getExclusiveMin());
45 rice.setInclusiveMax(student.getInclusiveMax());
46 rice.setDisplayLabelAttribute(student.getDisplayLabelAttribute());
47 rice.setUnique(student.getIsUnique());
48 rice.setCustomValidatorClass(student.getCustomValidatorClass());
49 if (student.getFormatterClass() != null) {
50 rice.setFormatterClass(student.getFormatterClass());
51 }
52 if (student.getValidCharactersConstraint() != null) {
53 rice.setValidCharactersConstraint(new Student2RiceValidCharactersConstraintConverter().convert(student.getValidCharactersConstraint()));
54 }
55 return rice;
56 }
57 }