Coverage Report - ar.com.fdvs.dj.domain.DynamicJasperDesign
 
Classes in this File Line Coverage Branch Coverage Complexity
DynamicJasperDesign
40%
4/10
0%
0/2
1.25
 
 1  
 /*
 2  
  * DynamicJasper: A library for creating reports dynamically by specifying
 3  
  * columns, groups, styles, etc. at runtime. It also saves a lot of development
 4  
  * time in many cases! (http://sourceforge.net/projects/dynamicjasper)
 5  
  *
 6  
  * Copyright (C) 2008  FDV Solutions (http://www.fdvsolutions.com)
 7  
  *
 8  
  * This library is free software; you can redistribute it and/or
 9  
  * modify it under the terms of the GNU Lesser General Public
 10  
  *
 11  
  * License as published by the Free Software Foundation; either
 12  
  *
 13  
  * version 2.1 of the License, or (at your option) any later version.
 14  
  *
 15  
  * This library is distributed in the hope that it will be useful,
 16  
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17  
  *
 18  
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 19  
  *
 20  
  * Lesser General Public License for more details.
 21  
  *
 22  
  * You should have received a copy of the GNU Lesser General Public
 23  
  * License along with this library; if not, write to the Free Software
 24  
  *
 25  
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 26  
  *
 27  
  *
 28  
  */
 29  
 
 30  
 package ar.com.fdvs.dj.domain;
 31  
 
 32  
 import java.util.TreeMap;
 33  
 
 34  
 import net.sf.jasperreports.engine.design.JasperDesign;
 35  
 import ar.com.fdvs.dj.domain.entities.Entity;
 36  
 
 37  
 /**
 38  
  * Custom implementation of JasperDesign class. It adds the concept of registerd </br>
 39  
  * parameters and some useful methods.</br>
 40  
  */
 41  
 public class DynamicJasperDesign extends JasperDesign {
 42  
 
 43  
         private static final long serialVersionUID = Entity.SERIAL_VERSION_UID;
 44  
         //<String paramName, CustomExpression expression>
 45  
         private TreeMap parametersWithValues; //There should not be "non serializable objects here"
 46  
 
 47  188
         public DynamicJasperDesign() {
 48  188
                 this.parametersWithValues = new TreeMap();
 49  188
         }
 50  
 
 51  
         public TreeMap getParametersWithValues() {
 52  882
                 return parametersWithValues;
 53  
         }
 54  
 
 55  
         public void setParametersWithValues(TreeMap parametersWithValues) {
 56  0
                 this.parametersWithValues = parametersWithValues;
 57  0
         }
 58  
 
 59  
         public int getNumberOfRegisteredParameters() {
 60  0
                 int result = 0;
 61  0
                 if (getParametersWithValues()!=null) {
 62  0
                         result = getParametersWithValues().size();
 63  
                 }
 64  0
                 return result;
 65  
         }
 66  
 
 67  
 }