Package net.sf.jasperreports.javascript
Class JavaScriptClassCompiler
java.lang.Object
net.sf.jasperreports.engine.design.JRAbstractCompiler
net.sf.jasperreports.javascript.JavaScriptCompilerBase
net.sf.jasperreports.javascript.JavaScriptClassCompiler
- All Implemented Interfaces:
- JRCompiler
Compiler for reports that use JavaScript as expression language.
 
 This implementation produces Java bytecode for the expressions.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class net.sf.jasperreports.javascript.JavaScriptCompilerBaseJavaScriptCompilerBase.Errors, JavaScriptCompilerBase.ScriptExpressionVisitor
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final StringProperty that determines the maximum number of report expressions that will be included in a single generated Java class.static final StringProperty that determines the optimization level to use when compiling expressions into Java bytecode.static final StringProperty that determines the maximum size of a script that will be compiled into a single Java class.Fields inherited from class net.sf.jasperreports.javascript.JavaScriptCompilerBaseEXCEPTION_MESSAGE_KEY_INVALID_COMPILE_DATA_TYPEFields inherited from class net.sf.jasperreports.engine.design.JRAbstractCompilerEXCEPTION_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.JRCompilerCOMPILER_CLASS, COMPILER_CLASSPATH, COMPILER_KEEP_JAVA_FILE, COMPILER_PREFIX, COMPILER_TEMP_DIR
- 
Constructor SummaryConstructorsConstructorDescriptionJavaScriptClassCompiler(JasperReportsContext jasperReportsContext) Creates a JavaScript compiler.
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidcompileScripts(JRCompilationUnit unit, org.mozilla.javascript.CompilerEnvirons compilerEnv, JavaScriptClassCompiler.CompileSources compileSources, JavaScriptCompiledData compiledData) protected StringcompileUnits(JRCompilationUnit[] units, String classpath, File tempDirFile) Compiles several expression evaluator units.Methods inherited from class net.sf.jasperreports.javascript.JavaScriptCompilerBasecheckLanguage, defaultExpressionCreator, estimatedExpressionCreator, generateSourceCode, getFieldVar, getParameterVar, getSourceFileName, getVariableVar, loadEvaluator, oldExpressionCreatorMethods inherited from class net.sf.jasperreports.engine.design.JRAbstractCompilercompileReport, createCompileData, createEvaluator, directValueFilter, effectiveDirectValueFilter, getCompilerClass, getSourceFile, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
- 
Field Details- 
PROPERTY_OPTIMIZATION_LEVELProperty that determines the optimization level to use when compiling expressions into Java bytecode. See- See Also:
 
- 
PROPERTY_EXPRESSIONS_PER_SCRIPTProperty that determines the maximum number of report expressions that will be included in a single generated Java class.- See Also:
 
- 
PROPERTY_SCRIPT_MAX_SIZEProperty that determines the maximum size of a script that will be compiled into a single Java class.- See Also:
 
- 
EXCEPTION_MESSAGE_KEY_UNEXPECTED_CLASS_NAME- See Also:
 
- 
EXCEPTION_MESSAGE_KEY_UNEXPECTED_CLASSES_LENGTH- See Also:
 
 
- 
- 
Constructor Details- 
JavaScriptClassCompilerCreates a JavaScript compiler.
 
- 
- 
Method Details- 
compileUnitsprotected 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 class- JRAbstractCompiler
- Parameters:
- units- the compilation units
- classpath- the compilation classpath
- tempDirFile- temporary directory
- Returns:
- a string containing compilation errors, or null if the compilation was successfull
- Throws:
- JRException
 
- 
compileScriptsprotected void compileScripts(JRCompilationUnit unit, org.mozilla.javascript.CompilerEnvirons compilerEnv, JavaScriptClassCompiler.CompileSources compileSources, JavaScriptCompiledData compiledData) 
 
-