001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.engine;
029:
030: import java.io.Serializable;
031:
032: import net.sf.jasperreports.engine.base.JRBaseReport;
033:
034: /**
035: * The actual representation of a compiled report. The main difference between a report and a report design is that
036: * reports are already compiled and validated, so many characteristics are read only.
037: * @author Teodor Danciu (teodord@users.sourceforge.net)
038: * @version $Id: JasperReport.java 1229 2006-04-19 10:27:35Z teodord $
039: */
040: public class JasperReport extends JRBaseReport {
041:
042: /**
043: *
044: */
045: private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;
046:
047: /**
048: * The name of the compiler class used to compile this report.
049: * The compiler is used to instantiate expression evaluators.
050: */
051: private String compilerClass = null;
052:
053: /**
054: * Unique string generated at compile time to distinguish between distinct compilations of reports having the same name.
055: */
056: private String compileNameSuffix;
057:
058: /**
059: * Expression evaluators compiled data.
060: */
061: private Serializable compileData = null;
062:
063: /**
064: * Constructs a report by specifying the template report and compile information.
065: *
066: * @param report the report template
067: * @param compilerClass the name of the class used to compile the report
068: * @param compileData the report/main dataset compile data
069: * @param expressionCollector instance used to collect expressions from the report design
070: * @param compileNameSuffix unique string used to distinguish between distinct compilations of reports having the same name
071: * <p>
072: * The collector is used to fetch the generated expression IDs.
073: */
074: public JasperReport(JRReport report, String compilerClass,
075: Serializable compileData,
076: JRExpressionCollector expressionCollector,
077: String compileNameSuffix) {
078: super (report, expressionCollector);
079:
080: this .compilerClass = compilerClass;
081: this .compileData = compileData;
082: this .compileNameSuffix = compileNameSuffix;
083: }
084:
085: /**
086: * Returns the name of the compiler class used to compile this report.
087: * <p>
088: * The compiler is used to instantiate expression evaluators.
089: *
090: * @return the name of the compiler class used to compile this report
091: */
092: public String getCompilerClass() {
093: return this .compilerClass;
094: }
095:
096: /**
097: * Returns data resulted from the expression evaluators compilation.
098: * <p>
099: * This data is used to create expression evaluators for report filling.
100: *
101: * @return expression evaluators compiled data
102: */
103: public Serializable getCompileData() {
104: return this .compileData;
105: }
106:
107: /**
108: * Returns the suffix of the class/unit names generated at report compilation.
109: * <p>
110: * This is used to distinguish between disctinct compilations of reports having the same name.
111: *
112: * @return the suffix of the class/unit names generated at report compilation
113: */
114: public String getCompileNameSuffix() {
115: return compileNameSuffix;
116: }
117: }
|