|
||||||||||
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 |
---|
Fields inherited from interface net.sf.jasperreports.engine.design.JRCompiler |
---|
COMPILER_PREFIX |
Constructor Summary | |
---|---|
protected |
JRAbstractCompiler(boolean needsSourceFiles)
Constructor. |
Method Summary | |
---|---|
protected abstract void |
checkLanguage(java.lang.String language)
Checks that the report language is supported by the compiler. |
JasperReport |
compileReport(JasperDesign jasperDesign)
Compiles a report design. |
protected abstract java.lang.String |
compileUnits(JRCompilationUnit[] units,
java.lang.String classpath,
java.io.File tempDirFile)
Compiles several expression evaluator units. |
protected abstract JRCompilationSourceCode |
generateSourceCode(JRSourceCompileTask sourceTask)
Generates expression evaluator code. |
protected java.lang.String |
getCompilerClass()
|
protected abstract java.lang.String |
getSourceFileName(java.lang.String unitName)
Returns the name of the source file where generated source code for an unit is saved. |
static java.lang.String |
getUnitName(JasperReport report,
JRCrosstab crosstab)
Returns the name of the expression evaluator unit for a crosstab of a report. |
static java.lang.String |
getUnitName(JasperReport report,
JRDataset dataset)
Returns the name of the expression evaluator unit for a dataset of a report. |
protected static java.lang.String |
getUnitName(JRReport report,
int crosstabId,
java.lang.String nameSuffix)
|
protected static java.lang.String |
getUnitName(JRReport report,
JRCrosstab crosstab,
JRExpressionCollector expressionCollector,
java.lang.String nameSuffix)
|
protected static java.lang.String |
getUnitName(JRReport report,
JRDataset dataset,
java.lang.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(java.io.Serializable compileData,
java.lang.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 |
Constructor Detail |
---|
protected JRAbstractCompiler(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.
Method Detail |
---|
public static java.lang.String getUnitName(JasperReport report, JRDataset dataset)
report
- the reportdataset
- the dataset
protected static java.lang.String getUnitName(JRReport report, JRDataset dataset, java.lang.String nameSuffix)
public static java.lang.String getUnitName(JasperReport report, JRCrosstab crosstab)
report
- the reportcrosstab
- the crosstab
protected static java.lang.String getUnitName(JRReport report, JRCrosstab crosstab, JRExpressionCollector expressionCollector, java.lang.String nameSuffix)
protected static java.lang.String getUnitName(JRReport report, int crosstabId, java.lang.String nameSuffix)
public final JasperReport compileReport(JasperDesign jasperDesign) throws JRException
JRCompiler
The 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 JRCompiler
jasperDesign
- the report design
JRException
protected java.lang.String getCompilerClass()
public JREvaluator loadEvaluator(JasperReport jasperReport) throws JRException
JRCompiler
loadEvaluator
in interface JRCompiler
jasperReport
- the report
JRException
public JREvaluator loadEvaluator(JasperReport jasperReport, JRDataset dataset) throws JRException
JRCompiler
loadEvaluator
in interface JRCompiler
jasperReport
- the reportdataset
- the dataset
JRException
public JREvaluator loadEvaluator(JasperReport jasperReport, JRCrosstab crosstab) throws JRException
JRCompiler
loadEvaluator
in interface JRCompiler
jasperReport
- the reportcrosstab
- the crosstab
JRException
protected abstract JREvaluator loadEvaluator(java.io.Serializable compileData, java.lang.String unitName) throws JRException
compileData
- the data saved when the report was compiledunitName
- the evaluator unit name
JRException
protected abstract void checkLanguage(java.lang.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 java.lang.String compileUnits(JRCompilationUnit[] units, java.lang.String classpath, java.io.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
JRException
protected abstract java.lang.String getSourceFileName(java.lang.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 |