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
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:
-
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_TYPEFields 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, reportClassFilterFields inherited from interface net.sf.jasperreports.engine.design.JRCompiler
COMPILER_CLASS, COMPILER_CLASSPATH, COMPILER_KEEP_JAVA_FILE, COMPILER_PREFIX, COMPILER_TEMP_DIR -
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptCompiler(JasperReportsContext jasperReportsContext) Creates a JavaScript compiler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckLanguage(String language) Checks that the report language is supported by the compiler.protected StringcompileUnits(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, oldExpressionCreatorMethods 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 Details
-
JavaScriptCompiler
Creates a JavaScript compiler.
-
-
Method Details
-
checkLanguage
Description copied from class:JRAbstractCompilerChecks that the report language is supported by the compiler.- Overrides:
checkLanguagein classJavaScriptCompilerBase- Parameters:
language- the report language- Throws:
JRException
-
compileUnits
protected String compileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) throws JRException Description copied from class:JRAbstractCompilerCompiles several expression evaluator units.The result of the compilation should be set by calling
setCompileDataon all compile units.- Specified by:
compileUnitsin 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
-