org.apache.commons.jexl3.internal

## Class TemplateInterpreter

- java.lang.Object
- - org.apache.commons.jexl3.parser.ParserVisitor
  - - org.apache.commons.jexl3.internal.Interpreter
    - - org.apache.commons.jexl3.internal.TemplateInterpreter

-     public class TemplateInterpreter
      extends Interpreter

  The type of interpreter to use during evaluation of templates.

  This context exposes its writer as '$jexl' to the scripts.

  public for introspection purpose.

- - ### Field Summary

    - ### Fields inherited from class org.apache.commons.jexl3.internal.Interpreter

      `arithmetic, cache, cancelled, context, EMPTY_PARAMS, frame, functions, functors, jexl, logger, ns, operators, silent, strictArithmetic, strictEngine, uberspect`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `include(TemplateScript script, Object... args)` Includes a call to another template.
    `void` | `print(int e)` Prints a unified expression evaluation result.
    `protected Object` | `resolveNamespace(String prefix, JexlNode node)` Resolves a namespace, eventually allocating an instance using context as constructor argument.
    `protected Object` | `visit(ASTFunctionNode node, Object data)`
    `protected Object` | `visit(ASTIdentifier node, Object data)`

    - ### Methods inherited from class org.apache.commons.jexl3.internal.Interpreter

      `call, executeAssign, findNullOperand, getAttribute, getAttribute, interpret, invocationFailed, isCancelled, isLocalVariable, isTernaryProtected, operatorError, setAttribute, setAttribute, unsolvableMethod, unsolvableProperty, unsolvableVariable, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit`

    - ### Methods inherited from class org.apache.commons.jexl3.parser.ParserVisitor

      `visit, visit`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### include

          public void include(TemplateScript script,
                     Object... args)

      Includes a call to another template.

      Includes another template using this template initial context and writer.

      Parameters:
        `script` - the TemplateScript to evaluate
        `args` - the arguments

    - #### print

          public void print(int e)

      Prints a unified expression evaluation result.
      Parameters:
        `e` - the expression number

    - #### resolveNamespace

          protected Object resolveNamespace(String prefix,
                                JexlNode node)

      Description copied from class: `Interpreter`
      Resolves a namespace, eventually allocating an instance using context as constructor argument.

      The lifetime of such instances span the current expression or script evaluation.

      Overrides:
        `resolveNamespace` in class `Interpreter`
      Parameters:
        `prefix` - the prefix name (may be null for global namespace)
        `node` - the AST node
      Returns:
        the namespace instance

    - #### visit

          protected Object visit(ASTFunctionNode node,
                     Object data)

      Overrides:
        `visit` in class `Interpreter`

    - #### visit

          protected Object visit(ASTIdentifier node,
                     Object data)

      Overrides:
        `visit` in class `Interpreter`

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.