Class ExprTreeVisitorDefault

  • All Implemented Interfaces:
    ExprTreeVisitor, TreeVisitor
    Direct Known Subclasses:
    MapBasedPrinter.ExprTreeVisitor

    public class ExprTreeVisitorDefault
    extends java.lang.Object
    implements ExprTreeVisitor
    The ExprTreeVisitorDefault abstract class provides a default implementation for the ExprTreeVisitor interface. This implementation does not perform any actions and does not collect any data. It stores the visitor status, which is by default set to Status.OK and is accessible via the getStatus and setStatus methods. All other methods defined by the ExprTreeVisitor interface and overridden by the class are empty. The class helps keep the size of other implementations of the ExprTreeVisitor interface to minimum when it is required to implement only a small number of ExprTreeVisitor methods to perform some actions on the expression tree being visited.
    • Constructor Detail

      • ExprTreeVisitorDefault

        public ExprTreeVisitorDefault()
        Constructs a default expression tree visitor and sets the visitor status to Status.OK.
    • Method Detail

      • getStatus

        public final TreeVisitor.Status getStatus()
        Description copied from interface: TreeVisitor
        Returns the current status of the visitor. The status guides further actions of the walker.
        Specified by:
        getStatus in interface TreeVisitor
        Returns:
        Current visitor status.
      • setStatus

        public final void setStatus​(TreeVisitor.Status status)
        Sets the current visitor status.
        Parameters:
        status - New visitor status.
        Throws:
        java.lang.IllegalArgumentException - if the parameter is null.
      • onBegin

        public void onBegin()
        Description copied from interface: TreeVisitor
        Notifies that processing of a hierarchical structure has been started.
        Specified by:
        onBegin in interface TreeVisitor
      • onEnd

        public void onEnd()
        Description copied from interface: TreeVisitor
        Notifies that processing of a hierarchical structure has been finished.
        Specified by:
        onEnd in interface TreeVisitor
      • getOperandOrder

        public int[] getOperandOrder()
        Description copied from interface: ExprTreeVisitor
        Returns an array of operand indexes that specify in which order the operands of the currently visited operator should be visited. If the order is standard (i.e. [0..N-1]), null is returned.
        Specified by:
        getOperandOrder in interface ExprTreeVisitor
        Returns:
        Array of operand indexes or null for the standard order.
      • onOperandBegin

        public void onOperandBegin​(NodeOperation operation,
                                   Node operand,
                                   int index)
        Description copied from interface: ExprTreeVisitor
        Notifies that visiting an expression operand has started.
        Specified by:
        onOperandBegin in interface ExprTreeVisitor
        Parameters:
        operation - Operation node.
        operand - Operand node.
        index - Operand index.
      • onOperandEnd

        public void onOperandEnd​(NodeOperation operation,
                                 Node operand,
                                 int index)
        Description copied from interface: ExprTreeVisitor
        Notifies that visiting an expression operand has finished.
        Specified by:
        onOperandEnd in interface ExprTreeVisitor
        Parameters:
        operation - Operation node.
        operand - Operand node.
        index - Operand index.
      • onValue

        public void onValue​(NodeValue value)
        Description copied from interface: ExprTreeVisitor
        Notifies that a value node has been visited.
        Specified by:
        onValue in interface ExprTreeVisitor
        Parameters:
        value - Value node.
      • onBoundVariableBegin

        public void onBoundVariableBegin​(NodeBinding node,
                                         NodeVariable variable,
                                         Node value)
        Description copied from interface: ExprTreeVisitor
        Notifies that visiting a bound variable has started. Bound value expression will be visited next as general expression.

        Bound variables are not visited at all.

        Specified by:
        onBoundVariableBegin in interface ExprTreeVisitor
        Parameters:
        node - Binding node.
        variable - Bound variable reference.
        value - Bound value expression.
      • onBoundVariableEnd

        public void onBoundVariableEnd​(NodeBinding node,
                                       NodeVariable variable,
                                       Node value)
        Description copied from interface: ExprTreeVisitor
        Notifies that visiting a bound variable has finished.
        Specified by:
        onBoundVariableEnd in interface ExprTreeVisitor
        Parameters:
        node - Binding node.
        variable - Bound variable reference.
        value - Bound value expression.