Coverage Report - org.kuali.student.common.ui.server.screenreport.jasper.KSCollectionDataSource
 
Classes in this File Line Coverage Branch Coverage Complexity
KSCollectionDataSource
100%
6/6
100%
2/2
2
 
 1  
 package org.kuali.student.common.ui.server.screenreport.jasper;
 2  
 
 3  
 import java.util.Collection;
 4  
 
 5  
 import net.sf.jasperreports.engine.JRException;
 6  
 import net.sf.jasperreports.engine.JRField;
 7  
 import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
 8  
 
 9  
 /**
 10  
  * 
 11  
  * This class overwrites the common JRBeanCollectionDataSource in order
 12  
  * to return a JRDataSource to be used on the subreport when the field is
 13  
  * called "subset". 
 14  
  * 
 15  
  * @author Kuali Rice Team (kuali-rice@googlegroups.com)
 16  
  *
 17  
  */
 18  
 public class KSCollectionDataSource extends JRBeanCollectionDataSource {
 19  
 
 20  
     public KSCollectionDataSource(Collection beanCollection) {
 21  48
         super(beanCollection);
 22  48
     }
 23  
 
 24  
     protected Object getFieldValue(Object bean, JRField field) throws JRException {
 25  328
         Object object = getBeanProperty(bean, getPropertyName(field));
 26  
 
 27  328
         if ("subset".equals(field.getName())) {
 28  44
             return new KSCollectionDataSource((Collection) object);
 29  
         }
 30  284
         return object;
 31  
     }
 32  
 
 33  
 }