1 28 package net.sf.jasperreports.crosstabs.fill; 29 30 import java.util.Map ; 31 32 import net.sf.jasperreports.engine.JRException; 33 import net.sf.jasperreports.engine.JRExpression; 34 import net.sf.jasperreports.engine.fill.JREvaluator; 35 import net.sf.jasperreports.engine.fill.JRFillExpressionEvaluator; 36 37 43 public class JRCrosstabExpressionEvaluator implements JRFillExpressionEvaluator 44 { 45 private final JREvaluator evaluator; 46 47 public JRCrosstabExpressionEvaluator(JREvaluator evaluator) 48 { 49 this.evaluator = evaluator; 50 } 51 52 53 public Object evaluate(JRExpression expression, byte evaluationType) throws JRException 54 { 55 if (evaluationType != JRExpression.EVALUATION_DEFAULT) 56 { 57 throw new JRException("The crosstab evaluator doesn't support old or estimated expression evaluation."); 58 } 59 60 return evaluator.evaluate(expression); 61 } 62 63 64 public void init(Map parametersMap, Map variablesMap, byte whenResourceMissingType) throws JRException 65 { 66 evaluator.init(parametersMap, null, variablesMap, whenResourceMissingType); 67 } 68 } 69 | Popular Tags |