Package net.sf.jasperreports.javascript
Class JavaScriptCompiler
- java.lang.Object
-
- net.sf.jasperreports.engine.design.JRAbstractCompiler
-
- net.sf.jasperreports.javascript.JavaScriptCompilerBase
-
- net.sf.jasperreports.javascript.JavaScriptCompiler
-
- All Implemented Interfaces:
JRCompiler
public class JavaScriptCompiler extends JavaScriptCompilerBase
Compiler for reports that use JavaScript as expression language. This implementation produces evaluators that compile expressions at fill time.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
JavaScriptEvaluator
,JavaScriptClassCompiler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.jasperreports.javascript.JavaScriptCompilerBase
JavaScriptCompilerBase.Errors, JavaScriptCompilerBase.ScriptExpressionVisitor
-
-
Field Summary
-
Fields inherited from class net.sf.jasperreports.javascript.JavaScriptCompilerBase
EXCEPTION_MESSAGE_KEY_INVALID_COMPILE_DATA_TYPE
-
Fields inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
EXCEPTION_MESSAGE_KEY_CROSSTAB_ID_NOT_FOUND, EXCEPTION_MESSAGE_KEY_DESIGN_COMPILE_ERROR, EXCEPTION_MESSAGE_KEY_LANGUAGE_NOT_SUPPORTED, EXCEPTION_MESSAGE_KEY_REPORT_EXPRESSIONS_COMPILE_ERROR, EXCEPTION_MESSAGE_KEY_TEMP_DIR_NOT_FOUND, jasperReportsContext, reportClassFilter
-
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
Constructors Constructor Description JavaScriptCompiler(JasperReportsContext jasperReportsContext)
Creates a JavaScript compiler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkLanguage(String language)
Checks that the report language is supported by the compiler.protected String
compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile)
Compiles several expression evaluator units.-
Methods inherited from class net.sf.jasperreports.javascript.JavaScriptCompilerBase
defaultExpressionCreator, estimatedExpressionCreator, generateSourceCode, getFieldVar, getParameterVar, getSourceFileName, getVariableVar, loadEvaluator, oldExpressionCreator
-
Methods inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
compileReport, createCompileData, createEvaluator, directValueFilter, effectiveDirectValueFilter, getCompilerClass, getSourceFile, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
-
-
-
-
Constructor Detail
-
JavaScriptCompiler
public JavaScriptCompiler(JasperReportsContext jasperReportsContext)
Creates a JavaScript compiler.
-
-
Method Detail
-
checkLanguage
protected void checkLanguage(String language) throws JRException
Description copied from class:JRAbstractCompiler
Checks that the report language is supported by the compiler.- Overrides:
checkLanguage
in classJavaScriptCompilerBase
- Parameters:
language
- the report language- Throws:
JRException
-
compileUnits
protected String compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) throws JRException
Description copied from class:JRAbstractCompiler
Compiles several expression evaluator units.The result of the compilation should be set by calling
setCompileData
on all compile units.- Specified by:
compileUnits
in classJRAbstractCompiler
- Parameters:
units
- the compilation unitsclasspath
- the compilation classpathtempDirFile
- temporary directory- Returns:
- a string containing compilation errors, or null if the compilation was successfull
- Throws:
JRException
-
-