1 28 package net.sf.jasperreports.engine.design; 29 30 import java.util.List ; 31 import java.util.Map ; 32 33 import net.sf.jasperreports.crosstabs.design.JRDesignCrosstab; 34 import net.sf.jasperreports.engine.JRExpression; 35 import net.sf.jasperreports.engine.JRExpressionCollector; 36 import net.sf.jasperreports.engine.JRVariable; 37 38 44 public class JRSourceCompileTask 45 { 46 private JasperDesign jasperDesign; 47 private String unitName; 48 private JRExpressionCollector expressionCollector; 49 private Map parametersMap; 50 private Map fieldsMap; 51 private Map variablesMap; 52 private JRVariable[] variables; 53 private List expressions; 54 private boolean onlyDefaultEvaluation; 55 56 57 protected JRSourceCompileTask(JasperDesign jasperDesign, String unitName, JRExpressionCollector expressionCollector, Map parametersMap, Map fieldsMap, Map variablesMap, JRVariable[] variables, List expressions, boolean onlyDefaultEvaluation) 58 { 59 this.jasperDesign = jasperDesign; 60 this.unitName = unitName; 61 this.expressionCollector = expressionCollector; 62 this.parametersMap = parametersMap; 63 this.fieldsMap = fieldsMap; 64 this.variablesMap = variablesMap; 65 this.variables = variables; 66 this.expressions = expressions; 67 this.onlyDefaultEvaluation = onlyDefaultEvaluation; 68 } 69 70 71 79 public JRSourceCompileTask(JasperDesign jasperDesign, JRDesignDataset dataset, JRExpressionCollector expressionCollector, String unitName) 80 { 81 this(jasperDesign, unitName, expressionCollector, 82 dataset.getParametersMap(), dataset.getFieldsMap(), dataset.getVariablesMap(), dataset.getVariables(), 83 expressionCollector.getExpressions(dataset), false); 84 } 85 86 87 95 public JRSourceCompileTask(JasperDesign jasperDesign, JRDesignCrosstab crosstab, JRExpressionCollector expressionCollector, String unitName) 96 { 97 this(jasperDesign, unitName, expressionCollector, 98 crosstab.getParametersMap(), null, crosstab.getVariablesMap(), crosstab.getVariables(), 99 expressionCollector.getExpressions(crosstab), true); 100 } 101 102 103 public List getExpressions() 104 { 105 return expressions; 106 } 107 108 109 public Map getFieldsMap() 110 { 111 return fieldsMap; 112 } 113 114 115 public JasperDesign getJasperDesign() 116 { 117 return jasperDesign; 118 } 119 120 121 public String [] getImports() 122 { 123 return jasperDesign.getImports(); 124 } 125 126 127 public boolean isOnlyDefaultEvaluation() 128 { 129 return onlyDefaultEvaluation; 130 } 131 132 133 public Map getParametersMap() 134 { 135 return parametersMap; 136 } 137 138 139 public String getUnitName() 140 { 141 return unitName; 142 } 143 144 145 public JRVariable[] getVariables() 146 { 147 return variables; 148 } 149 150 151 public Map getVariablesMap() 152 { 153 return variablesMap; 154 } 155 156 157 public Integer getExpressionId(JRExpression expression) 158 { 159 return expressionCollector.getExpressionId(expression); 160 } 161 } 162 | Popular Tags |