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 | 0 | public class Student2RiceAttributeDefinitionConverter { |
26 | |
|
27 | 0 | private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(Student2RiceAttributeDefinitionConverter.class); |
28 | |
|
29 | |
public AttributeDefinition convert(AttributeDefinitionInfc student) { |
30 | 0 | AttributeDefinition rice = new AttributeDefinition(); |
31 | 0 | rice.setName(student.getName()); |
32 | 0 | rice.setChildEntryName(student.getChildEntryName()); |
33 | 0 | rice.setDataType(student.getDataType()); |
34 | 0 | rice.setRequired(student.getIsRequired()); |
35 | |
|
36 | |
|
37 | 0 | rice.setMinLength(student.getMinLength()); |
38 | 0 | rice.setMaxLength(student.getMaxLength()); |
39 | 0 | rice.setForceUppercase(student.getIsForceUppercase()); |
40 | 0 | rice.setShortLabel(student.getShortLabel()); |
41 | 0 | rice.setSummary(student.getSummary()); |
42 | 0 | rice.setLabel(student.getLabel()); |
43 | 0 | rice.setDescription(student.getDescription()); |
44 | 0 | rice.setExclusiveMin(student.getExclusiveMin()); |
45 | 0 | rice.setInclusiveMax(student.getInclusiveMax()); |
46 | 0 | rice.setDisplayLabelAttribute(student.getDisplayLabelAttribute()); |
47 | 0 | rice.setUnique(student.getIsUnique()); |
48 | 0 | rice.setCustomValidatorClass(student.getCustomValidatorClass()); |
49 | 0 | if (student.getFormatterClass() != null) { |
50 | 0 | rice.setFormatterClass(student.getFormatterClass()); |
51 | |
} |
52 | 0 | if (student.getValidCharactersConstraint() != null) { |
53 | 0 | rice.setValidCharactersConstraint(new Student2RiceValidCharactersConstraintConverter().convert(student.getValidCharactersConstraint())); |
54 | |
} |
55 | 0 | return rice; |
56 | |
} |
57 | |
} |