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.design;
029:
030: import net.sf.jasperreports.crosstabs.JRCrosstab;
031: import net.sf.jasperreports.engine.JRDataset;
032: import net.sf.jasperreports.engine.JRException;
033: import net.sf.jasperreports.engine.JasperReport;
034: import net.sf.jasperreports.engine.fill.JREvaluator;
035: import net.sf.jasperreports.engine.util.JRProperties;
036:
037: /**
038: * @author Teodor Danciu (teodord@users.sourceforge.net)
039: * @version $Id: JRCompiler.java 1828 2007-08-24 13:58:43Z teodord $
040: */
041: public interface JRCompiler {
042:
043: /**
044: * Prefix for properties that map report compilers to expression languages.
045: * <p/>
046: * Properties having this prefix are used to indicate the JRCompiler implementation to be used when compiling
047: * report designs that rely on the expression language specified as propety suffix.
048: */
049: public static final String COMPILER_PREFIX = JRProperties.PROPERTY_PREFIX
050: + "compiler.";
051:
052: /**
053: * Compiles a report design.
054: * <p>
055: * The compilation consists of verification of the design, generation of expression evaluators
056: * and construction of a serializable read-only version of the report.
057: * <p>
058: * A report compiler should usually extend {@link JRAbstractCompiler JRAbstractCompiler}.
059: *
060: *
061: * @param jasperDesign the report design
062: * @return the compiled report
063: * @throws JRException
064: */
065: public JasperReport compileReport(JasperDesign jasperDesign)
066: throws JRException;
067:
068: /**
069: * Loads the evaluator for a report's main dataset.
070: *
071: * @param jasperReport the report
072: * @return the evaluator for the report's main dataset
073: * @throws JRException
074: */
075: public JREvaluator loadEvaluator(JasperReport jasperReport)
076: throws JRException;
077:
078: /**
079: * Loads a expression evaluator class for a dataset of a report.
080: *
081: * @param jasperReport the report
082: * @param dataset the dataset
083: * @return an instance of the dataset evaluator class
084: * @throws JRException
085: */
086: public JREvaluator loadEvaluator(JasperReport jasperReport,
087: JRDataset dataset) throws JRException;
088:
089: /**
090: * Loads a expression evaluator class for a crosstab of a report.
091: *
092: * @param jasperReport the report
093: * @param crosstab the crosstab
094: * @return an instance of the dataset evaluator class
095: * @throws JRException
096: */
097: public JREvaluator loadEvaluator(JasperReport jasperReport,
098: JRCrosstab crosstab) throws JRException;
099:
100: }
|