net.sf.jasperreports.compilers.package-info Maven / Gradle / Ivy
/*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2023 Cloud Software Group, Inc. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see .
*/
/**
* Contains classes for report compiling and expressions evaluating.
*
* Compiling Report Templates
* Source report templates, created either by using the API or by parsing JRXML files, are
* subject to the report compilation process before they are filled with data.
*
* This is necessary to make various consistency validations and to incorporate into these
* report templates data used to evaluate all report expressions at runtime.
*
* The compilation process transforms
* {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} objects into
* {@link net.sf.jasperreports.engine.JasperReport JasperReport} objects. Both classes are
* implementations of the same basic {@link net.sf.jasperreports.engine.JRReport JRReport}
* interface. However, {@link net.sf.jasperreports.engine.JasperReport JasperReport} objects cannot be modified once they are produced,
* while {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} objects can. This is because some modifications made on the
* report template would probably require re-validation, or if a report expression is
* modified, the compiler-associated data stored inside the report template would have to be
* updated.
*
* {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} objects are produced when parsing JRXML files using the
* {@link net.sf.jasperreports.engine.xml.JRXmlLoader JRXmlLoader} or created directly by the parent
* application if dynamic report templates are required. The GUI tools for editing
* JasperReports templates also work with this class to make in-memory modifications to
* the report templates before storing them on disk.
*
* A {@link net.sf.jasperreports.engine.design.JasperDesign JasperDesign} object must be subject to the report compilation process to produce a
* {@link net.sf.jasperreports.engine.JasperReport JasperReport} object.
*
* Central to this process is the {@link net.sf.jasperreports.engine.design.JRCompiler JRCompiler}
* interface, which defines two methods, one being the following:
*
*
* public JasperReport compileReport(JasperDesign design) throws JRException;
* There are several implementations for this compiler interface depending on the language
* used for the report expressions or the mechanism used for their runtime evaluation.
*
* Expressions Scripting Language
* The default language for the report expressions is Java, but report expressions
* can be written in Groovy, JavaScript or any other scripting language as long as a report
* compiler implementation that can evaluate them at runtime is available.
*
* JasperReports currently ships report compiler implementations for the Groovy scripting
* language (http://groovy.codehaus.org) and
* JavaScript (http://www.mozilla.org/rhino).
* The compiler implementation classes are:
*
* - {@link net.sf.jasperreports.compilers.JRGroovyCompiler JRGroovyCompiler}
* - {@link net.sf.jasperreports.compilers.JavaScriptCompiler JavaScriptCompiler}
*
* Historically, these compiler implementations used to be shipped as separate samples,
* but now they are part of the core library.
*
* Related Documentation
* JasperReports Tutorial
*/
package net.sf.jasperreports.compilers;