net.sf.jasperreports.compilers

## Class JavaScriptCompiledEvaluator

- java.lang.Object
- - net.sf.jasperreports.engine.fill.JREvaluator
  - - net.sf.jasperreports.compilers.JavaScriptCompiledEvaluator

- All Implemented Interfaces:
    DatasetExpressionEvaluator, JasperReportsContextAware

      public class JavaScriptCompiledEvaluator
      extends JREvaluator
      implements JasperReportsContextAware

  JavaScript expression evaluator that uses Java bytecode compiled by `JavaScriptClassCompiler`.
  Version:
    $Id: JavaScriptCompiledEvaluator.java 6919 2014-02-21 16:14:20Z lucianc $
  Author:
    Lucian Chirita (lucianc@users.sourceforge.net)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static java.lang.String` | `EXPRESSION_ID_VAR`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaScriptCompiledEvaluator(JasperReportsContext jasperReportsContext, java.lang.String unitName, JavaScriptCompiledData compiledData)` Create a JavaScript expression evaluator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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)`
    `void` | `setJasperReportsContext(JasperReportsContext context)`

    - ### Methods inherited from class net.sf.jasperreports.engine.fill.JREvaluator

      `evaluate, evaluateEstimated, evaluateOld, getFunctionSupport, 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(JasperReportsContext jasperReportsContext,
                                     java.lang.String unitName,
                                     JavaScriptCompiledData compiledData)

      Create a JavaScript expression evaluator.
      Parameters:
        `jasperReportsContext` -
        `unitName` -
        `compiledData` - the report compile data

  - ### Method Detail

    - #### getScriptClassLoader

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

    - #### setJasperReportsContext

          public void setJasperReportsContext(JasperReportsContext context)

      Specified by:
        `setJasperReportsContext` in interface `JasperReportsContextAware`

    - #### 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