Class InterpreterBase.CallDispatcher

java.lang.Object
org.apache.commons.jexl3.internal.InterpreterBase.CallDispatcher
Enclosing class:
InterpreterBase

protected class InterpreterBase.CallDispatcher extends Object
Helping dispatch function calls.
  • Field Details

    • node

      final JexlNode node
      The syntactic node.
    • cacheable

      final boolean cacheable
      Whether solution is cacheable.
    • narrow

      boolean narrow
      Whether arguments have been narrowed.
    • vm

      The method to call.
    • target

      Object target
      The method invocation target.
    • argv

      Object[] argv
      The actual arguments.
    • funcall

      The cacheable funcall if any.
  • Constructor Details

    • CallDispatcher

      CallDispatcher(JexlNode anode, boolean acacheable)
      Dispatcher ctor.
      Parameters:
      anode - the syntactic node.
      acacheable - whether resolution can be cached
  • Method Details

    • eval

      protected Object eval(String methodName) throws Exception
      Evaluates the method previously dispatched.
      Parameters:
      methodName - the method name
      Returns:
      the method invocation result
      Throws:
      Exception - when invocation fails
    • isArithmeticMethod

      protected boolean isArithmeticMethod(String methodName, Object[] arguments)
      Whether the method is an arithmetic method.
      Parameters:
      methodName - the method name
      arguments - the method arguments
      Returns:
      true if arithmetic, false otherwise
    • isContextMethod

      protected boolean isContextMethod(String methodName, Object[] arguments)
      Whether the method is a context method.
      Parameters:
      methodName - the method name
      arguments - the method arguments
      Returns:
      true if arithmetic, false otherwise
    • isTargetMethod

      protected boolean isTargetMethod(Object ntarget, String methodName, Object[] arguments)
      Whether the method is a target method.
      Parameters:
      ntarget - the target instance
      methodName - the method name
      arguments - the method arguments
      Returns:
      true if arithmetic, false otherwise
    • tryEval

      protected Object tryEval(Object ntarget, String methodName, Object[] arguments)
      Attempt to reuse last funcall cached in volatile JexlNode.value (if it was cacheable).
      Parameters:
      ntarget - the target instance
      methodName - the method name
      arguments - the method arguments
      Returns:
      TRY_FAILED if invocation was not possible or failed, the result otherwise