WhereValidator

Overview

Checks WhereExpressions for errors. The main purpose of this class is to scan all objects of WhereExpession trees and to make sure that it contains valid field names.

Location

 

constructor

 

constructor

 

WhereValidator()

 

Sub New()

Validate (WhereExpression, array of String, String): Int32

Scans all objects of the WhereExpression tree for errors, using the Visit method of the parent WhereVisitor class.

 

method Validate(expression: WhereExpression; allowedFieldNames: array of String; out errors: String): Int32

 

Int32 Validate(WhereExpression expression, String[] allowedFieldNames, out String errors)

 

Function Validate(expression As WhereExpression, allowedFieldNames As String(), <OutAttribute> ByRef errors As String) As Int32

Parameters:

  • expression:
  • allowedFieldNames:
  • errors:

Validate (WhereExpression, array of String, String): Int32

Scans all objects of the WhereExpression tree for errors, using the Visit method of the parent WhereVisitor class.

 

class method Validate(expression: WhereExpression; allowedFieldNames: array of String; out errors: String): Int32

 

static Int32 Validate(WhereExpression expression, String[] allowedFieldNames, out String errors)

 

Shared Function Validate(expression As WhereExpression, allowedFieldNames As String(), <OutAttribute> ByRef errors As String) As Int32

Parameters:

  • expression:
  • allowedFieldNames:
  • errors:

Visit  protected    (declared in WhereVisitor)

Calls the appropriate VisitXXX method depending on the type of the given WhereExpression.

 

method Visit(expression: WhereExpression): WhereExpression

 

WhereExpression Visit(WhereExpression expression)

 

Function Visit(expression As WhereExpression) As WhereExpression

Parameters:

  • expression:

VisitBetween  protected    (declared in WhereVisitor)

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(expression: BetweenExpression): WhereExpression

 

WhereExpression VisitBetween(BetweenExpression expression)

 

Function VisitBetween(expression As BetweenExpression) As WhereExpression

Parameters:

  • expression:

VisitBinary  protected    (declared in WhereVisitor)

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(expression: BinaryExpression): WhereExpression

 

WhereExpression VisitBinary(BinaryExpression expression)

 

Function VisitBinary(expression As BinaryExpression) As WhereExpression

Parameters:

  • expression:

VisitConstant  protected    (declared in WhereVisitor)

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(expression: ConstantExpression): WhereExpression

 

WhereExpression VisitConstant(ConstantExpression expression)

 

Function VisitConstant(expression As ConstantExpression) As WhereExpression

Parameters:

  • expression:

VisitDateTimeNow  protected    (declared in WhereVisitor)

 

method VisitDateTimeNow(expression: DateTimeNowExpression): WhereExpression

 

WhereExpression VisitDateTimeNow(DateTimeNowExpression expression)

 

Function VisitDateTimeNow(expression As DateTimeNowExpression) As WhereExpression

Parameters:

  • expression:

VisitDateTimePart  protected    (declared in WhereVisitor)

 

method VisitDateTimePart(expression: DateTimePartExpression): WhereExpression

 

WhereExpression VisitDateTimePart(DateTimePartExpression expression)

 

Function VisitDateTimePart(expression As DateTimePartExpression) As WhereExpression

Parameters:

  • expression:

VisitDateTimeToday  protected    (declared in WhereVisitor)

 

method VisitDateTimeToday(expression: DateTimeTodayExpression): WhereExpression

 

WhereExpression VisitDateTimeToday(DateTimeTodayExpression expression)

 

Function VisitDateTimeToday(expression As DateTimeTodayExpression) As WhereExpression

Parameters:

  • expression:

VisitField  protected

Overloaded method that will be called for each FieldExpression contained in the test WhereExpression. It validates that the FieldExpression.FieldName is one of the allowedFieldNames given through the Validate method. Otherwise it adds an error message to the error list, which will be returned as out parameter of the Validate method.

 

method VisitField(expression: FieldExpression): WhereExpression

 

WhereExpression VisitField(FieldExpression expression)

 

Function VisitField(expression As FieldExpression) As WhereExpression

Parameters:

  • expression:

VisitFunctionCall  protected    (declared in WhereVisitor)

 

method VisitFunctionCall(expression: FunctionCallExpression): WhereExpression

 

WhereExpression VisitFunctionCall(FunctionCallExpression expression)

 

Function VisitFunctionCall(expression As FunctionCallExpression) As WhereExpression

Parameters:

  • expression:

VisitList  protected    (declared in WhereVisitor)

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(expression: ListExpression): WhereExpression

 

WhereExpression VisitList(ListExpression expression)

 

Function VisitList(expression As ListExpression) As WhereExpression

Parameters:

  • expression:

VisitMacro  protected    (declared in WhereVisitor)

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(expression: MacroExpression): WhereExpression

 

WhereExpression VisitMacro(MacroExpression expression)

 

Function VisitMacro(expression As MacroExpression) As WhereExpression

Parameters:

  • expression:

VisitNull  protected    (declared in WhereVisitor)

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

 

method VisitNull(expression: NullExpression): WhereExpression

 

WhereExpression VisitNull(NullExpression expression)

 

Function VisitNull(expression As NullExpression) As WhereExpression

Parameters:

  • expression:

VisitParameter  protected    (declared in WhereVisitor)

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(expression: ParameterExpression): WhereExpression

 

WhereExpression VisitParameter(ParameterExpression expression)

 

Function VisitParameter(expression As ParameterExpression) As WhereExpression

Parameters:

  • expression:

VisitUnary  protected

Overloaded method that will be called for each UnaryExpression contained in the test WhereExpression. It checks if the UnaryExpression.Expression is a BinaryExpression, otherwise it adds an error message to the error list, which will be returned as out parameter of the Validate method.

 

method VisitUnary(expression: UnaryExpression): WhereExpression

 

WhereExpression VisitUnary(UnaryExpression expression)

 

Function VisitUnary(expression As UnaryExpression) As WhereExpression

Parameters:

  • expression:

 

Validate (WhereExpression, array of String, String): Int32

Scans all objects of the WhereExpression tree for errors, using the Visit method of the parent WhereVisitor class.

 

class method Validate(expression: WhereExpression; allowedFieldNames: array of String; out errors: String): Int32

 

static Int32 Validate(WhereExpression expression, String[] allowedFieldNames, out String errors)

 

Shared Function Validate(expression As WhereExpression, allowedFieldNames As String(), <OutAttribute> ByRef errors As String) As Int32

Parameters:

  • expression:
  • allowedFieldNames:
  • errors:

 

constructor

 

constructor

 

WhereValidator()

 

Sub New()

Validate (WhereExpression, array of String, String): Int32

Scans all objects of the WhereExpression tree for errors, using the Visit method of the parent WhereVisitor class.

 

method Validate(expression: WhereExpression; allowedFieldNames: array of String; out errors: String): Int32

 

Int32 Validate(WhereExpression expression, String[] allowedFieldNames, out String errors)

 

Function Validate(expression As WhereExpression, allowedFieldNames As String(), <OutAttribute> ByRef errors As String) As Int32

Parameters:

  • expression:
  • allowedFieldNames:
  • errors:

Visit  protected    (declared in WhereVisitor)

Calls the appropriate VisitXXX method depending on the type of the given WhereExpression.

 

method Visit(expression: WhereExpression): WhereExpression

 

WhereExpression Visit(WhereExpression expression)

 

Function Visit(expression As WhereExpression) As WhereExpression

Parameters:

  • expression:

VisitBetween  protected    (declared in WhereVisitor)

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(expression: BetweenExpression): WhereExpression

 

WhereExpression VisitBetween(BetweenExpression expression)

 

Function VisitBetween(expression As BetweenExpression) As WhereExpression

Parameters:

  • expression:

VisitBinary  protected    (declared in WhereVisitor)

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(expression: BinaryExpression): WhereExpression

 

WhereExpression VisitBinary(BinaryExpression expression)

 

Function VisitBinary(expression As BinaryExpression) As WhereExpression

Parameters:

  • expression:

VisitConstant  protected    (declared in WhereVisitor)

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(expression: ConstantExpression): WhereExpression

 

WhereExpression VisitConstant(ConstantExpression expression)

 

Function VisitConstant(expression As ConstantExpression) As WhereExpression

Parameters:

  • expression:

VisitDateTimeNow  protected    (declared in WhereVisitor)

 

method VisitDateTimeNow(expression: DateTimeNowExpression): WhereExpression

 

WhereExpression VisitDateTimeNow(DateTimeNowExpression expression)

 

Function VisitDateTimeNow(expression As DateTimeNowExpression) As WhereExpression

Parameters:

  • expression:

VisitDateTimePart  protected    (declared in WhereVisitor)

 

method VisitDateTimePart(expression: DateTimePartExpression): WhereExpression

 

WhereExpression VisitDateTimePart(DateTimePartExpression expression)

 

Function VisitDateTimePart(expression As DateTimePartExpression) As WhereExpression

Parameters:

  • expression:

VisitDateTimeToday  protected    (declared in WhereVisitor)

 

method VisitDateTimeToday(expression: DateTimeTodayExpression): WhereExpression

 

WhereExpression VisitDateTimeToday(DateTimeTodayExpression expression)

 

Function VisitDateTimeToday(expression As DateTimeTodayExpression) As WhereExpression

Parameters:

  • expression:

VisitField  protected

Overloaded method that will be called for each FieldExpression contained in the test WhereExpression. It validates that the FieldExpression.FieldName is one of the allowedFieldNames given through the Validate method. Otherwise it adds an error message to the error list, which will be returned as out parameter of the Validate method.

 

method VisitField(expression: FieldExpression): WhereExpression

 

WhereExpression VisitField(FieldExpression expression)

 

Function VisitField(expression As FieldExpression) As WhereExpression

Parameters:

  • expression:

VisitFunctionCall  protected    (declared in WhereVisitor)

 

method VisitFunctionCall(expression: FunctionCallExpression): WhereExpression

 

WhereExpression VisitFunctionCall(FunctionCallExpression expression)

 

Function VisitFunctionCall(expression As FunctionCallExpression) As WhereExpression

Parameters:

  • expression:

VisitList  protected    (declared in WhereVisitor)

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(expression: ListExpression): WhereExpression

 

WhereExpression VisitList(ListExpression expression)

 

Function VisitList(expression As ListExpression) As WhereExpression

Parameters:

  • expression:

VisitMacro  protected    (declared in WhereVisitor)

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(expression: MacroExpression): WhereExpression

 

WhereExpression VisitMacro(MacroExpression expression)

 

Function VisitMacro(expression As MacroExpression) As WhereExpression

Parameters:

  • expression:

VisitNull  protected    (declared in WhereVisitor)

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

 

method VisitNull(expression: NullExpression): WhereExpression

 

WhereExpression VisitNull(NullExpression expression)

 

Function VisitNull(expression As NullExpression) As WhereExpression

Parameters:

  • expression:

VisitParameter  protected    (declared in WhereVisitor)

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(expression: ParameterExpression): WhereExpression

 

WhereExpression VisitParameter(ParameterExpression expression)

 

Function VisitParameter(expression As ParameterExpression) As WhereExpression

Parameters:

  • expression:

VisitUnary  protected

Overloaded method that will be called for each UnaryExpression contained in the test WhereExpression. It checks if the UnaryExpression.Expression is a BinaryExpression, otherwise it adds an error message to the error list, which will be returned as out parameter of the Validate method.

 

method VisitUnary(expression: UnaryExpression): WhereExpression

 

WhereExpression VisitUnary(UnaryExpression expression)

 

Function VisitUnary(expression As UnaryExpression) As WhereExpression

Parameters:

  • expression: