Coverage Report - org.kuali.rice.kns.service.impl.BusinessObjectSerializerServiceImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
BusinessObjectSerializerServiceImpl
0%
0/13
0%
0/4
3
 
 1  
 /*
 2  
  * Copyright 2007 The Kuali Foundation
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 1.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.opensource.org/licenses/ecl1.php
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 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  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 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  
 }