Package net.sf.jasperreports.javascript
Class JavaScriptCompiledEvaluator
java.lang.Object
net.sf.jasperreports.engine.fill.JREvaluator
net.sf.jasperreports.javascript.JavaScriptCompiledEvaluator
- All Implemented Interfaces:
DatasetExpressionEvaluator
,JasperReportsContextAware
JavaScript expression evaluator that uses Java bytecode compiled by
JavaScriptClassCompiler
.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
-
Field Summary
FieldsFields inherited from class net.sf.jasperreports.engine.fill.JREvaluator
EXCEPTION_MESSAGE_KEY_RESOURCE_NOT_FOUND, ignoreNPE, PROPERTY_IGNORE_NPE
-
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptCompiledEvaluator
(JasperReportsContext jasperReportsContext, String unitName, JavaScriptCompiledData compiledData) Create a JavaScript expression evaluator. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
customizedInit
(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap) Initializes the parameters, fields and variables of the evaluator.protected Object
evaluate
(int id) Evaluates an expression using current fields and variables values.protected Object
evaluateEstimated
(int id) Evaluates an expression using estimated variables values.protected Object
evaluateExpression
(int expressionIndex) protected Object
evaluateOld
(int id) Evaluates an expression using old fields and variables values.protected JavaScriptCompiledData.ExpressionIndexes
getExpression
(int id) protected static JavaScriptClassLoader
getScriptClassLoader
(String unitName) void
Methods inherited from class net.sf.jasperreports.engine.fill.JREvaluator
evaluate, evaluateEstimated, evaluateOld, getFunctionSupport, handleEvaluationException, handleMissingResource, init, msg, msg, msg, msg, setDirectExpressionEvaluators, str
-
Field Details
-
EXPRESSION_ID_VAR
- See Also:
-
-
Constructor Details
-
JavaScriptCompiledEvaluator
public JavaScriptCompiledEvaluator(JasperReportsContext jasperReportsContext, String unitName, JavaScriptCompiledData compiledData) Create a JavaScript expression evaluator.- Parameters:
jasperReportsContext
-unitName
-compiledData
- the report compile data
-
-
Method Details
-
getScriptClassLoader
-
setJasperReportsContext
- Specified by:
setJasperReportsContext
in interfaceJasperReportsContextAware
-
customizedInit
protected void customizedInit(Map<String, JRFillParameter> parametersMap, Map<String, throws JRExceptionJRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap) Description copied from class:JREvaluator
Initializes the parameters, fields and variables of the evaluator.- Specified by:
customizedInit
in classJREvaluator
- Parameters:
parametersMap
- the parameters indexed by namefieldsMap
- the fields indexed by namevariablesMap
- the variables indexed by name- Throws:
JRException
-
evaluate
Description copied from class:JREvaluator
Evaluates an expression using current fields and variables values.- Specified by:
evaluate
in classJREvaluator
- Parameters:
id
- the expression id- Returns:
- the result of the evaluation
- Throws:
Throwable
- See Also:
-
evaluateEstimated
Description copied from class:JREvaluator
Evaluates an expression using estimated variables values.- Specified by:
evaluateEstimated
in classJREvaluator
- Parameters:
id
- the expression id- Returns:
- the result of the evaluation
- Throws:
Throwable
- See Also:
-
evaluateOld
Description copied from class:JREvaluator
Evaluates an expression using old fields and variables values.- Specified by:
evaluateOld
in classJREvaluator
- Parameters:
id
- the expression id- Returns:
- the result of the evaluation
- Throws:
Throwable
- See Also:
-
getExpression
-
evaluateExpression
-