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