1 28 package net.sf.jasperreports.engine.xml; 29 30 import net.sf.jasperreports.engine.JRVariable; 31 import net.sf.jasperreports.engine.design.JRDesignExpression; 32 import net.sf.jasperreports.engine.design.JRDesignVariable; 33 34 import org.xml.sax.Attributes ; 35 36 37 41 public class JRVariableExpressionFactory extends JRBaseFactory 42 { 43 44 45 48 public Object createObject(Attributes atts) 49 { 50 JRDesignVariable variable = (JRDesignVariable)digester.peek(); 51 52 JRDesignExpression expression = new JRDesignExpression(); 53 if ( 54 variable.getCalculation() == JRVariable.CALCULATION_COUNT 55 || variable.getCalculation() == JRVariable.CALCULATION_DISTINCT_COUNT 56 ) 57 { 58 expression.setValueClassName(java.lang.Object .class.getName()); 59 } 60 else 61 { 62 expression.setValueClassName(variable.getValueClassName()); 63 } 64 65 return expression; 66 } 67 68 69 } 70 | Popular Tags |