1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.service.impl; |
17 | |
|
18 | |
import org.apache.commons.collections.CollectionUtils; |
19 | |
import org.kuali.rice.kns.datadictionary.MaintainableSectionDefinition; |
20 | |
import org.kuali.rice.kns.util.documentserlializer.MaintenanceDocumentPropertySerializibilityEvaluator; |
21 | |
import org.kuali.rice.krad.datadictionary.MaintenanceDocumentEntry; |
22 | |
import org.kuali.rice.krad.util.documentserializer.AlwaysTruePropertySerializibilityEvaluator; |
23 | |
import org.kuali.rice.krad.util.documentserializer.PropertySerializabilityEvaluator; |
24 | |
|
25 | |
import java.util.List; |
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | 0 | public class BusinessObjectSerializerServiceImpl extends org.kuali.rice.krad.service.impl.BusinessObjectSerializerServiceImpl { |
31 | |
|
32 | |
@Override |
33 | |
public PropertySerializabilityEvaluator getPropertySerizabilityEvaluator(Object businessObject) { |
34 | 0 | PropertySerializabilityEvaluator evaluator = null; |
35 | |
|
36 | 0 | String docTypeName = getDocumentDictionaryService().getMaintenanceDocumentTypeName(businessObject.getClass()); |
37 | 0 | MaintenanceDocumentEntry maintenanceDocumentEntry = |
38 | |
getDocumentDictionaryService().getMaintenanceDocumentEntry(docTypeName); |
39 | |
|
40 | 0 | if (maintenanceDocumentEntry instanceof org.kuali.rice.kns.datadictionary.MaintenanceDocumentEntry) { |
41 | 0 | List<MaintainableSectionDefinition> maintainableSectionDefinitions = |
42 | |
((org.kuali.rice.kns.datadictionary.MaintenanceDocumentEntry) maintenanceDocumentEntry).getMaintainableSections(); |
43 | 0 | if (CollectionUtils.isEmpty(maintainableSectionDefinitions)) { |
44 | 0 | evaluator = new AlwaysTruePropertySerializibilityEvaluator(); |
45 | |
} else { |
46 | 0 | evaluator = new MaintenanceDocumentPropertySerializibilityEvaluator(); |
47 | 0 | evaluator.initializeEvaluatorForDataObject(businessObject); |
48 | |
} |
49 | 0 | } |
50 | |
else { |
51 | 0 | evaluator = new AlwaysTruePropertySerializibilityEvaluator(); |
52 | |
} |
53 | |
|
54 | 0 | return evaluator; |
55 | |
} |
56 | |
} |