1 package com.calipso.reportgenerator.common; 2 3 import com.calipso.reportgenerator.reportcalculator.DataDefinition; 4 5 import java.io.Serializable ; 6 import java.util.Map ; 7 8 14 public class ReportFieldSpec implements DataDefinition, Serializable { 15 16 private int dataSourceIndex; 17 private int reportSourceIndex; 18 private int reportIndex; 19 private String name; 20 private String caption; 21 private boolean calculated; 22 private String externalData; 23 private Map dataSourceIndexes; 24 private boolean inReportDefinition; 25 private Map reportSourceIndexes; 26 27 30 31 public ReportFieldSpec() { 32 } 33 34 35 39 public ReportFieldSpec(String name) { 40 this.name = name; 41 } 42 43 47 public String getName() { 48 return name; 49 } 50 51 55 public void setName(String name) { 56 this.name = name; 57 } 58 59 63 public String getCaption() { 64 return caption; 65 } 66 67 71 public void setCaption(String caption) { 72 this.caption = caption; 73 } 74 75 80 public int getIndex() { 81 return getReportSourceIndex(); 82 } 83 84 89 public boolean getCalculated() { 90 return calculated; 91 } 92 93 97 public void setCalculated(boolean calculated) { 98 this.calculated = calculated; 99 } 100 101 105 106 public String getExternalData() { 107 return externalData; 108 } 109 110 114 115 public void setExternalData(String externalData) { 116 this.externalData = externalData; 117 } 118 119 120 125 public int getDataSourceIndex() { 126 return dataSourceIndex; 127 } 128 129 133 134 public void setDataSourceIndex(int dataSourceIndex) { 135 this.dataSourceIndex = dataSourceIndex; 136 } 137 138 141 142 public int getReportSourceIndex() { 143 return reportSourceIndex; 144 } 145 146 150 151 public void setReportSourceIndex(int reportSourceIndex) { 152 this.reportSourceIndex = reportSourceIndex; 153 } 154 155 156 160 public int getReportIndex() { 161 return reportIndex; 162 } 163 164 168 public void setReportIndex(int reportIndex) { 169 this.reportIndex = reportIndex; 170 } 171 172 178 protected int getDataSourceIndexFromName(String referencedName) { 179 return ((Integer )getDataSourceIndexes().get(referencedName)).intValue(); 180 } 181 182 186 187 public Map getDataSourceIndexes() { 188 return dataSourceIndexes; 189 } 190 191 public Map getReportSourceIndexes() { 192 return reportSourceIndexes; 193 } 194 195 public void setReportSourceIndexes(Map reportSourceIndexes) { 196 this.reportSourceIndexes = reportSourceIndexes; 197 } 198 199 204 public void setDataSourceIndexes(Map values) { 205 dataSourceIndexes = values; 206 } 207 208 214 public boolean getInReportDefinition() { 215 return inReportDefinition; 216 } 217 218 222 public void setInReportDefinition(boolean inReportDefinition) { 223 this.inReportDefinition = inReportDefinition; 224 } 225 226 227 234 protected String resolveCaption(boolean multilanguaje, Map localization, String caption) { 235 if (multilanguaje && (localization != null) && (caption != null ) && localization.containsKey(caption)){ 236 return localization.get(caption).toString(); 237 } else if ((localization!=null)&& (caption != null )&&(localization.containsKey(caption))){ 238 return localization.get(caption).toString(); 239 } else { 240 return caption; 241 } 242 } 243 244 } 245 | Popular Tags |