net.sf.jasperreports.compilers
Class JavaScriptCompiledEvaluator

java.lang.Object
  extended by net.sf.jasperreports.engine.fill.JREvaluator
      extended by net.sf.jasperreports.compilers.JavaScriptCompiledEvaluator
All Implemented Interfaces:
DatasetExpressionEvaluator

public class JavaScriptCompiledEvaluator
extends JREvaluator

JavaScript expression evaluator that uses Java bytecode compiled by JavaScriptClassCompiler.

Version:
$Id: JavaScriptCompiledEvaluator.java 5451 2012-06-14 15:35:10Z lucianc $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)

Field Summary
protected static java.lang.String EXPRESSION_ID_VAR
           
 
Constructor Summary
JavaScriptCompiledEvaluator(java.lang.String unitName, JavaScriptCompiledData compiledData)
          Create a JavaScript expression evaluator.
 
Method Summary
protected  void customizedInit(java.util.Map<java.lang.String,JRFillParameter> parametersMap, java.util.Map<java.lang.String,JRFillField> fieldsMap, java.util.Map<java.lang.String,JRFillVariable> variablesMap)
          Initializes the parameters, fields and variables of the evaluator.
protected  java.lang.Object evaluate(int id)
          Evaluates an expression using current fields and variables values.
protected  java.lang.Object evaluateEstimated(int id)
          Evaluates an expression using estimated variables values.
protected  java.lang.Object evaluateExpression(int expressionIndex)
           
protected  java.lang.Object evaluateOld(int id)
          Evaluates an expression using old fields and variables values.
protected  JavaScriptCompiledData.ExpressionIndexes getExpression(int id)
           
protected static JavaScriptClassLoader getScriptClassLoader(java.lang.String unitName)
           
 
Methods inherited from class net.sf.jasperreports.engine.fill.JREvaluator
evaluate, evaluateEstimated, evaluateOld, handleMissingResource, init, msg, msg, msg, msg, str
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPRESSION_ID_VAR

protected static final java.lang.String EXPRESSION_ID_VAR
See Also:
Constant Field Values
Constructor Detail

JavaScriptCompiledEvaluator

public JavaScriptCompiledEvaluator(java.lang.String unitName,
                                   JavaScriptCompiledData compiledData)
Create a JavaScript expression evaluator.

Parameters:
unitName -
compileData - the report compile data
Method Detail

getScriptClassLoader

protected static JavaScriptClassLoader getScriptClassLoader(java.lang.String unitName)

customizedInit

protected void customizedInit(java.util.Map<java.lang.String,JRFillParameter> parametersMap,
                              java.util.Map<java.lang.String,JRFillField> fieldsMap,
                              java.util.Map<java.lang.String,JRFillVariable> variablesMap)
                       throws JRException
Description copied from class: JREvaluator
Initializes the parameters, fields and variables of the evaluator.

Specified by:
customizedInit in class JREvaluator
Parameters:
parametersMap - the parameters indexed by name
fieldsMap - the fields indexed by name
variablesMap - the variables indexed by name
Throws:
JRException

evaluate

protected java.lang.Object evaluate(int id)
                             throws java.lang.Throwable
Description copied from class: JREvaluator
Evaluates an expression using current fields and variables values.

Specified by:
evaluate in class JREvaluator
Parameters:
id - the expression id
Returns:
the result of the evaluation
Throws:
java.lang.Throwable
See Also:
JRExpression.EVALUATION_DEFAULT, JRFillVariable.getValue(), JRFillField.getValue()

evaluateEstimated

protected java.lang.Object evaluateEstimated(int id)
                                      throws java.lang.Throwable
Description copied from class: JREvaluator
Evaluates an expression using estimated variables values.

Specified by:
evaluateEstimated in class JREvaluator
Parameters:
id - the expression id
Returns:
the result of the evaluation
Throws:
java.lang.Throwable
See Also:
JRExpression.EVALUATION_ESTIMATED, JRFillVariable.getEstimatedValue()

evaluateOld

protected java.lang.Object evaluateOld(int id)
                                throws java.lang.Throwable
Description copied from class: JREvaluator
Evaluates an expression using old fields and variables values.

Specified by:
evaluateOld in class JREvaluator
Parameters:
id - the expression id
Returns:
the result of the evaluation
Throws:
java.lang.Throwable
See Also:
JRExpression.EVALUATION_OLD, JRFillVariable.getOldValue(), JRFillField.getOldValue()

getExpression

protected JavaScriptCompiledData.ExpressionIndexes getExpression(int id)

evaluateExpression

protected java.lang.Object evaluateExpression(int expressionIndex)


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com