|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jasperreports.engine.design.JRAbstractCompiler net.sf.jasperreports.compilers.JavaScriptCompiler
public class JavaScriptCompiler
Compiler for reports that use JavaScript as expression language.
Field Summary |
---|
Fields inherited from interface net.sf.jasperreports.engine.design.JRCompiler |
---|
COMPILER_PREFIX |
Constructor Summary | |
---|---|
JavaScriptCompiler()
Creates a JavaScript compiler. |
Method Summary | |
---|---|
protected void |
appendError(java.lang.StringBuffer errors,
int errorCount,
org.mozilla.javascript.EvaluatorException e)
|
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. |
protected JRCompilationSourceCode |
generateSourceCode(JRSourceCompileTask sourceTask)
Generates expression evaluator code. |
protected java.lang.String |
getSourceFileName(java.lang.String unitName)
Returns the name of the source file where generated source code for an unit is saved. |
protected 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 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 |
---|
public JavaScriptCompiler()
Method Detail |
---|
protected void checkLanguage(java.lang.String language) throws JRException
JRAbstractCompiler
checkLanguage
in class JRAbstractCompiler
language
- the report language
JRException
protected java.lang.String compileUnits(JRCompilationUnit[] units, java.lang.String classpath, java.io.File tempDirFile) throws JRException
JRAbstractCompiler
The result of the compilation should be set by calling
setCompileData
on all compile units.
compileUnits
in class JRAbstractCompiler
units
- the compilation unitsclasspath
- the compilation classpathtempDirFile
- temporary directory
JRException
protected void appendError(java.lang.StringBuffer errors, int errorCount, org.mozilla.javascript.EvaluatorException e)
protected JRCompilationSourceCode generateSourceCode(JRSourceCompileTask sourceTask) throws JRException
JRAbstractCompiler
generateSourceCode
in class JRAbstractCompiler
sourceTask
- the source code generation information
JRException
protected java.lang.String getSourceFileName(java.lang.String unitName)
JRAbstractCompiler
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.
getSourceFileName
in class JRAbstractCompiler
unitName
- the unit name
protected JREvaluator loadEvaluator(java.io.Serializable compileData, java.lang.String unitName) throws JRException
JRAbstractCompiler
loadEvaluator
in class JRAbstractCompiler
compileData
- the data saved when the report was compiledunitName
- the evaluator unit name
JRException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |