public class JavaScriptEvaluator extends JREvaluator implements JasperReportsContextAware
JavaScriptCompiler
Modifier and Type | Field and Description |
---|---|
static String |
EXCEPTION_MESSAGE_KEY_EVALUATOR_LOAD_ERROR |
static String |
PROPERTY_OPTIMIZATION_LEVEL
Property that determines the optimization level used when compiling expressions.
|
EXCEPTION_MESSAGE_KEY_RESOURCE_NOT_FOUND, PROPERTY_IGNORE_NPE
Constructor and Description |
---|
JavaScriptEvaluator(JasperReportsContext jrContext,
JavaScriptCompileData compileData)
Create a JavaScript expression evaluator.
|
Modifier and Type | Method and Description |
---|---|
protected 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(String expression) |
protected Object |
evaluateOld(int id)
Evaluates an expression using old fields and variables values.
|
protected JavaScriptCompileData.Expression |
getExpression(int id) |
void |
setJasperReportsContext(JasperReportsContext context) |
evaluate, evaluateEstimated, evaluateOld, getFunctionSupport, handleMissingResource, init, msg, msg, msg, msg, str
public static final String PROPERTY_OPTIMIZATION_LEVEL
public static final String EXCEPTION_MESSAGE_KEY_EVALUATOR_LOAD_ERROR
public JavaScriptEvaluator(JasperReportsContext jrContext, JavaScriptCompileData compileData)
compileData
- the report compile datapublic void setJasperReportsContext(JasperReportsContext context)
setJasperReportsContext
in interface JasperReportsContextAware
protected void customizedInit(Map<String,JRFillParameter> parametersMap, Map<String,JRFillField> fieldsMap, Map<String,JRFillVariable> variablesMap) throws JRException
JREvaluator
customizedInit
in class JREvaluator
parametersMap
- the parameters indexed by namefieldsMap
- the fields indexed by namevariablesMap
- the variables indexed by nameJRException
protected Object evaluate(int id) throws Throwable
JREvaluator
evaluate
in class JREvaluator
id
- the expression idThrowable
JRExpression.EVALUATION_DEFAULT
,
JRFillVariable.getValue()
,
JRFillField.getValue()
protected Object evaluateEstimated(int id) throws Throwable
JREvaluator
evaluateEstimated
in class JREvaluator
id
- the expression idThrowable
JRExpression.EVALUATION_ESTIMATED
,
JRFillVariable.getEstimatedValue()
protected Object evaluateOld(int id) throws Throwable
JREvaluator
evaluateOld
in class JREvaluator
id
- the expression idThrowable
JRExpression.EVALUATION_OLD
,
JRFillVariable.getOldValue()
,
JRFillField.getOldValue()
protected JavaScriptCompileData.Expression getExpression(int id)
Copyright © 2017. All rights reserved.