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 java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
import org.kuali.rice.krad.datadictionary.AttributeDefinition; |
21 | |
import org.kuali.rice.krad.datadictionary.DataObjectEntry; |
22 | |
import org.kuali.student.r2.common.datadictionary.dto.AttributeDefinitionInfo; |
23 | |
import org.kuali.student.r2.common.datadictionary.dto.DictionaryEntryInfo; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | 0 | public class Rice2StudentDictionaryEntryConverter { |
30 | |
|
31 | 0 | private static org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(Rice2StudentDictionaryEntryConverter.class); |
32 | |
|
33 | |
public DictionaryEntryInfo convert(DataObjectEntry rice) { |
34 | 0 | DictionaryEntryInfo.Builder bldr = new DictionaryEntryInfo.Builder(); |
35 | 0 | bldr.setObjectClass(rice.getFullClassName()); |
36 | 0 | bldr.setName(rice.getName()); |
37 | 0 | bldr.setObjectLabel(rice.getObjectLabel()); |
38 | 0 | bldr.setObjectDescription(rice.getObjectDescription()); |
39 | 0 | bldr.setTitleAttribute(rice.getTitleAttribute()); |
40 | 0 | bldr.setPrimaryKeys(rice.getPrimaryKeys()); |
41 | 0 | if (rice.getAttributes() != null) { |
42 | 0 | List<AttributeDefinitionInfo> list = new ArrayList(rice.getAttributes().size()); |
43 | 0 | for (AttributeDefinition ad : rice.getAttributes()) { |
44 | 0 | list.add(new Rice2StudentAttributeDefinitionConverter ().convert(ad)); |
45 | |
} |
46 | 0 | bldr.setAttributes (list); |
47 | |
} |
48 | 0 | return bldr.build(); |
49 | |
} |
50 | |
} |