net.sf.jasperreports.compilers
Class JavaScriptCompiler

java.lang.Object
  extended by net.sf.jasperreports.engine.design.JRAbstractCompiler
      extended by net.sf.jasperreports.compilers.JavaScriptCompilerBase
          extended by net.sf.jasperreports.compilers.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.

Version:
$Id: JavaScriptCompiler.java 5451 2012-06-14 15:35:10Z lucianc $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)
See Also:
JavaScriptEvaluator, JavaScriptClassCompiler

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.jasperreports.compilers.JavaScriptCompilerBase
JavaScriptCompilerBase.Errors, JavaScriptCompilerBase.ScriptExpressionVisitor
 
Field Summary
 
Fields inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
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
JavaScriptCompiler()
          Deprecated. Replaced by JavaScriptCompiler(JasperReportsContext).
JavaScriptCompiler(JasperReportsContext jasperReportsContext)
          Creates a JavaScript compiler.
 
Method Summary
protected  void checkLanguage(java.lang.String language)
          Checks that the report language is supported by the compiler.
protected  java.lang.String compileUnits(JRCompilationUnit[] units, java.lang.String classpath, java.io.File tempDirFile)
          Compiles several expression evaluator units.
 
Methods inherited from class net.sf.jasperreports.compilers.JavaScriptCompilerBase
defaultExpressionCreator, estimatedExpressionCreator, generateSourceCode, getFieldVar, getParameterVar, getSourceFileName, getVariableVar, loadEvaluator, oldExpressionCreator
 
Methods inherited from class net.sf.jasperreports.engine.design.JRAbstractCompiler
compileReport, getCompilerClass, getUnitName, getUnitName, getUnitName, getUnitName, getUnitName, loadEvaluator, loadEvaluator, loadEvaluator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptCompiler

public JavaScriptCompiler(JasperReportsContext jasperReportsContext)
Creates a JavaScript compiler.


JavaScriptCompiler

public JavaScriptCompiler()
Deprecated. Replaced by JavaScriptCompiler(JasperReportsContext).

Method Detail

checkLanguage

protected void checkLanguage(java.lang.String language)
                      throws JRException
Description copied from class: JRAbstractCompiler
Checks that the report language is supported by the compiler.

Overrides:
checkLanguage in class JavaScriptCompilerBase
Parameters:
language - the report language
Throws:
JRException

compileUnits

protected java.lang.String compileUnits(JRCompilationUnit[] units,
                                        java.lang.String classpath,
                                        java.io.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 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


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com