Package net.sf.jasperreports.javascript
Class JavaScriptEvaluator
java.lang.Object
net.sf.jasperreports.engine.fill.JREvaluator
net.sf.jasperreports.javascript.JavaScriptEvaluator
- All Implemented Interfaces:
DatasetExpressionEvaluator,JasperReportsContextAware
JavaScript expression evaluator that compiles expressions at fill time.
- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringProperty that determines the optimization level used when compiling expressions.Fields inherited from class net.sf.jasperreports.engine.fill.JREvaluator
EXCEPTION_MESSAGE_KEY_RESOURCE_NOT_FOUND, ignoreNPE, PROPERTY_IGNORE_NPE -
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptEvaluator(JasperReportsContext jrContext, JavaScriptCompileData compileData) Create a JavaScript expression evaluator. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcustomizedInit(Map<String, JRFillParameter> parametersMap, Map<String, JRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap) Initializes the parameters, fields and variables of the evaluator.protected Objectevaluate(int id) Evaluates an expression using current fields and variables values.protected ObjectevaluateEstimated(int id) Evaluates an expression using estimated variables values.protected ObjectevaluateExpression(String expression) protected ObjectevaluateOld(int id) Evaluates an expression using old fields and variables values.protected JavaScriptCompileData.ExpressiongetExpression(int id) voidMethods inherited from class net.sf.jasperreports.engine.fill.JREvaluator
evaluate, evaluateEstimated, evaluateOld, getFunctionSupport, handleEvaluationException, handleMissingResource, init, msg, msg, msg, msg, setDirectExpressionEvaluators, str
-
Field Details
-
PROPERTY_OPTIMIZATION_LEVEL
- See Also:
-
EXCEPTION_MESSAGE_KEY_EVALUATOR_LOAD_ERROR
- See Also:
-
-
Constructor Details
-
JavaScriptEvaluator
Create a JavaScript expression evaluator.- Parameters:
compileData- the report compile data
-
-
Method Details
-
setJasperReportsContext
- Specified by:
setJasperReportsContextin interfaceJasperReportsContextAware
-
customizedInit
protected void customizedInit(Map<String, JRFillParameter> parametersMap, Map<String, throws JRExceptionJRFillField> fieldsMap, Map<String, JRFillVariable> variablesMap) Description copied from class:JREvaluatorInitializes the parameters, fields and variables of the evaluator.- Specified by:
customizedInitin 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:JREvaluatorEvaluates an expression using current fields and variables values.- Specified by:
evaluatein classJREvaluator- Parameters:
id- the expression id- Returns:
- the result of the evaluation
- Throws:
Throwable- See Also:
-
evaluateEstimated
Description copied from class:JREvaluatorEvaluates an expression using estimated variables values.- Specified by:
evaluateEstimatedin classJREvaluator- Parameters:
id- the expression id- Returns:
- the result of the evaluation
- Throws:
Throwable- See Also:
-
evaluateOld
Description copied from class:JREvaluatorEvaluates an expression using old fields and variables values.- Specified by:
evaluateOldin classJREvaluator- Parameters:
id- the expression id- Returns:
- the result of the evaluation
- Throws:
Throwable- See Also:
-
getExpression
-
evaluateExpression
-