Interface ExpressionProcessor

  • All Known Implementing Classes:
    Expression.SymbolFinder, SubquerySchemaComputer

    public interface ExpressionProcessor
    This interface is used to implement scans or transformations of expression trees by specifying what to do when entering or leaving each expression node. When leaving an expression node, a replacement expression may be returned that will replace the expression node that was just left.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void enter​(Expression node)
      This method is called when expression-traversal is entering a particular node in the expression tree.
      Expression leave​(Expression node)
      This method is called when expression-traversal is leaving a particular node in the expression tree.
    • Method Detail

      • enter

        void enter​(Expression node)
        This method is called when expression-traversal is entering a particular node in the expression tree. It is not possible to replace a node when entering it, because this would unnecessarily complicate the semantics of expression-tree traversal.
        Parameters:
        node - the Expression node being entered
      • leave

        Expression leave​(Expression node)
        This method is called when expression-traversal is leaving a particular node in the expression tree. To facilitate mutation of expression trees, this method must return an Expression object: If the expression processor wants to replace the node being left with a different node, this method can return the replacement node; otherwise, the method should return the passed-in node.
        Parameters:
        node - the Expression node being left
        Returns:
        the Expression object to use for the node being left; either node if no changes are to be made, or a new Expression object if node should be replaced.