|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jasperreports.engine.design.JRAbstractCompiler
public abstract class JRAbstractCompiler
Base class for report compilers.
| Field Summary | |
|---|---|
protected JasperReportsContext |
jasperReportsContext
|
| Fields inherited from interface net.sf.jasperreports.engine.design.JRCompiler |
|---|
COMPILER_CLASS, COMPILER_CLASSPATH, COMPILER_KEEP_JAVA_FILE, COMPILER_PREFIX, COMPILER_TEMP_DIR |
| Constructor Summary | |
|---|---|
protected |
JRAbstractCompiler(boolean needsSourceFiles)
Deprecated. Replaced by JRAbstractCompiler(JasperReportsContext, boolean). |
protected |
JRAbstractCompiler(JasperReportsContext jasperReportsContext,
boolean needsSourceFiles)
Constructor. |
| Method Summary | |
|---|---|
protected abstract void |
checkLanguage(String language)
Checks that the report language is supported by the compiler. |
JasperReport |
compileReport(JasperDesign jasperDesign)
Compiles a report design. |
protected abstract String |
compileUnits(JRCompilationUnit[] units,
String classpath,
File tempDirFile)
Compiles several expression evaluator units. |
protected abstract JRCompilationSourceCode |
generateSourceCode(JRSourceCompileTask sourceTask)
Generates expression evaluator code. |
protected String |
getCompilerClass()
|
protected abstract String |
getSourceFileName(String unitName)
Returns the name of the source file where generated source code for an unit is saved. |
static String |
getUnitName(JasperReport report,
JRCrosstab crosstab)
Returns the name of the expression evaluator unit for a crosstab of a report. |
static String |
getUnitName(JasperReport report,
JRDataset dataset)
Returns the name of the expression evaluator unit for a dataset of a report. |
protected static String |
getUnitName(JRReport report,
int crosstabId,
String nameSuffix)
|
protected static String |
getUnitName(JRReport report,
JRCrosstab crosstab,
JRExpressionCollector expressionCollector,
String nameSuffix)
|
protected static String |
getUnitName(JRReport report,
JRDataset dataset,
String nameSuffix)
|
JREvaluator |
loadEvaluator(JasperReport jasperReport)
Loads the evaluator for a report's main dataset. |
JREvaluator |
loadEvaluator(JasperReport jasperReport,
JRCrosstab crosstab)
Loads a expression evaluator class for a crosstab of a report. |
JREvaluator |
loadEvaluator(JasperReport jasperReport,
JRDataset dataset)
Loads a expression evaluator class for a dataset of a report. |
protected abstract JREvaluator |
loadEvaluator(Serializable compileData,
String unitName)
Creates an expression evaluator instance from data saved when the report was compiled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final JasperReportsContext jasperReportsContext
| Constructor Detail |
|---|
protected JRAbstractCompiler(JasperReportsContext jasperReportsContext,
boolean needsSourceFiles)
needsSourceFiles - whether the compiler needs source files or is able to do in memory compilation
If true, the generated code is saved in source files to be used by the compiler.
protected JRAbstractCompiler(boolean needsSourceFiles)
JRAbstractCompiler(JasperReportsContext, boolean).
| Method Detail |
|---|
public static String getUnitName(JasperReport report,
JRDataset dataset)
report - the reportdataset - the dataset
protected static String getUnitName(JRReport report,
JRDataset dataset,
String nameSuffix)
public static String getUnitName(JasperReport report,
JRCrosstab crosstab)
report - the reportcrosstab - the crosstab
protected static String getUnitName(JRReport report,
JRCrosstab crosstab,
JRExpressionCollector expressionCollector,
String nameSuffix)
protected static String getUnitName(JRReport report,
int crosstabId,
String nameSuffix)
public final JasperReport compileReport(JasperDesign jasperDesign)
throws JRException
JRCompilerThe compilation consists of verification of the design, generation of expression evaluators and construction of a serializable read-only version of the report.
A report compiler should usually extend JRAbstractCompiler.
compileReport in interface JRCompilerjasperDesign - the report design
JRExceptionprotected String getCompilerClass()
public JREvaluator loadEvaluator(JasperReport jasperReport)
throws JRException
JRCompiler
loadEvaluator in interface JRCompilerjasperReport - the report
JRException
public JREvaluator loadEvaluator(JasperReport jasperReport,
JRDataset dataset)
throws JRException
JRCompiler
loadEvaluator in interface JRCompilerjasperReport - the reportdataset - the dataset
JRException
public JREvaluator loadEvaluator(JasperReport jasperReport,
JRCrosstab crosstab)
throws JRException
JRCompiler
loadEvaluator in interface JRCompilerjasperReport - the reportcrosstab - the crosstab
JRException
protected abstract JREvaluator loadEvaluator(Serializable compileData,
String unitName)
throws JRException
compileData - the data saved when the report was compiledunitName - the evaluator unit name
JRException
protected abstract void checkLanguage(String language)
throws JRException
language - the report language
JRException
protected abstract JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask)
throws JRException
sourceTask - the source code generation information
JRException
protected abstract String compileUnits(JRCompilationUnit[] units,
String classpath,
File tempDirFile)
throws JRException
The result of the compilation should be set by calling
setCompileData on all compile units.
units - the compilation unitsclasspath - the compilation classpathtempDirFile - temporary directory
JRExceptionprotected abstract String getSourceFileName(String unitName)
If the compiler needs source files for compilation
or COMPILER_KEEP_JAVA_FILE is set, the generated source
will be saved in a file having the name returned by this method.
unitName - the unit name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||