WhereVisitor

Overview

This class represents the implementation of Visitor patterns and sets the strategy of traversal for the WhereExpression tree.

It is the base class and as such contains basic rules of visiting objects, which may compose a tree. Separate concrete visitor classes derived from it can perform some particular operations, by implementing these operations in their respective Visit methods.

Location


Instance Methods


constructor

Empty constructor that creates an instance of the WhereVisitor.

 

constructor

 

WhereVisitor()

visit  protected

 

method visit(expression: WhereExpression): WhereExpression

 

WhereExpression visit(WhereExpression expression)

Parameters:

  • expression:

visitBetween  protected

Defines the base rule of traversal for BetweenExpression. First, it visits Expression, then Lower Expression and finally Upper Expression. If parts of BetweenExpression were changed during visits, a new BetweenExpression, containing the new parts, will be obtained as a result.

 

method visitBetween(anExpression: BetweenExpression): WhereExpression

 

WhereExpression visitBetween(BetweenExpression anExpression)

Parameters:

  • anExpression: The given between expresion to visit.

visitBinary  protected

Defines the base rule of traversal for BinaryExpression. First, it visits Left Expression, then Right Expression. If parts of BinaryExpression were changed during visits, a new BinaryExpression, containing the new parts, will be obtained.

 

method visitBinary(anExpression: BinaryExpression): WhereExpression

 

WhereExpression visitBinary(BinaryExpression anExpression)

Parameters:

  • anExpression: The given binaryexpresion to visit.

visitConstant  protected

Defines the base rule of traversal for ConstantExpressions. Since ConstantExpressions can't consist of other expressions (it's the final object in the WhereExpression tree), this method returns the given ConstantExpression.

 

method visitConstant(anExpression: ConstantExpression): WhereExpression

 

WhereExpression visitConstant(ConstantExpression anExpression)

Parameters:

  • anExpression: The given constant expresion to visit.

visitDateTimeNow  protected

 

method visitDateTimeNow(expression: DateTimeNowExpression): WhereExpression

 

WhereExpression visitDateTimeNow(DateTimeNowExpression expression)

Parameters:

  • expression:

visitDateTimePart  protected

 

method visitDateTimePart(expression: DateTimePartExpression): WhereExpression

 

WhereExpression visitDateTimePart(DateTimePartExpression expression)

Parameters:

  • expression:

visitDateTimeToday  protected

 

method visitDateTimeToday(expression: DateTimeTodayExpression): WhereExpression

 

WhereExpression visitDateTimeToday(DateTimeTodayExpression expression)

Parameters:

  • expression:

visitField  protected

Defines the base rule of traversal for FieldExpressions. Since FieldExpressions can't consist of other expressions (it's the final object in the WhereExpression tree), this method returns the given FieldExpression.

 

method visitField(anExpression: FieldExpression): WhereExpression

 

WhereExpression visitField(FieldExpression anExpression)

Parameters:

  • anExpression: The given field expresion to visit.

visitFunctionCall  protected

 

method visitFunctionCall(expression: FunctionCallExpression): WhereExpression

 

WhereExpression visitFunctionCall(FunctionCallExpression expression)

Parameters:

  • expression:

visitList  protected

Defines the base rule of traversal for ListExpressions. This method goes through the list and visits every expression on it. If at least one expression on the list was changed during the visit, a new ListExpression, containing the changed items, will be obtained as a result.

 

method visitList(anExpression: ListExpression): WhereExpression

 

WhereExpression visitList(ListExpression anExpression)

Parameters:

  • anExpression: The given list expresion to visit.

visitMacro  protected

Defines the base rule of traversal for MacroExpressions. This method goes through the items list and visits every expression on it. If at least one expression on the list was changed during the visit, a new MacroExpression, containing the changed items, will be obtained as a result.

 

method visitMacro(anExpression: MacroExpression): WhereExpression

 

WhereExpression visitMacro(MacroExpression anExpression)

Parameters:

  • anExpression: The given macro expresion to visit.

visitNull  protected

Defines the base rule of traversal for NullExpressions. Since NullExpression can't consist of other expressions, this method returns the given expression.

 

method visitNull(anExpression: NullExpression): WhereExpression

 

WhereExpression visitNull(NullExpression anExpression)

Parameters:

  • anExpression: The given null expresion to visit.

visitParameter  protected

Defines the base rule of traversal for ParameterExpressions. Since ParameterExpression can't consist of other expressions (it's the final object in the WhereExpression tree), this method returns the given ParameterExpression.

 

method visitParameter(anExpression: ParameterExpression): WhereExpression

 

WhereExpression visitParameter(ParameterExpression anExpression)

Parameters:

  • anExpression: The given parameter expresion to visit.

visitUnary  protected

Defines the base rule of traversal for UnaryExpression. It visits Expression, contained in the given UnaryExpression. If it is changed during the visit, a new UnaryExpression, containing the changed Expression, will be created.

 

method visitUnary(anExpression: UnaryExpression): WhereExpression

 

WhereExpression visitUnary(UnaryExpression anExpression)

Parameters:

  • anExpression: The given unary expresion to visit.