Class LambdaExpressionNestedState


  • public final class LambdaExpressionNestedState
    extends java.lang.Object
    Stores the state required for correct evaluation of lambda expressions. Lambda expressions may be nested. Correct evaluation requires knowledge not just of the current lambda expression, but also of any nested and nesting expressions.

    The sets of nodes for parsed expressions are cached and, as a result, a set of nodes may be being used by multiple concurrent threads. This means any state relating to evaluation cannot be stored in the nodes. State is therefore stored in the EvaluationContext which is created, used for a single evaluation and then discarded.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(org.apache.el.parser.Node node)
      Returns whether the given node is the node that created this state or a descendant of that node.
      boolean getHasFormalParameters()
      Returns whether the current lambda expression has formal parameters.
      int getNestingCount()
      Returns the current nesting count.
      void incrementNestingCount()
      Increments the nesting count for nested lambda expressions.
      void setHasFormalParameters()
      Marks that the current lambda expression has formal parameters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LambdaExpressionNestedState

        public LambdaExpressionNestedState​(org.apache.el.parser.Node root)
        Constructor.
        Parameters:
        root - The lambda expression node that created this state
    • Method Detail

      • contains

        public boolean contains​(org.apache.el.parser.Node node)
        Returns whether the given node is the node that created this state or a descendant of that node.
        Parameters:
        node - The node to check
        Returns:
        true if the given node is the node that created this state or a descendant of that node
      • incrementNestingCount

        public void incrementNestingCount()
        Increments the nesting count for nested lambda expressions.
      • getNestingCount

        public int getNestingCount()
        Returns the current nesting count.
        Returns:
        the nesting count
      • setHasFormalParameters

        public void setHasFormalParameters()
        Marks that the current lambda expression has formal parameters.
      • getHasFormalParameters

        public boolean getHasFormalParameters()
        Returns whether the current lambda expression has formal parameters.
        Returns:
        true if the lambda has formal parameters