org.apache.olingo.server.api.uri.queryoption.expression

## Interface ExpressionVisitor<T>

- Type Parameters:
    `T` - Return type

      public interface ExpressionVisitor<T>

  Generic interface to define expression visitors with arbitrary return types.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `visitAlias(String aliasName)` Called for each traversed `Alias` expression
    `T` | `visitBinaryOperator(BinaryOperatorKind operator, T left, List<T> right)` Called for each traversed `Binary` expression
    `T` | `visitBinaryOperator(BinaryOperatorKind operator, T left, T right)` Called for each traversed `Binary` expression
    `T` | `visitEnum(EdmEnumType type, List<String> enumValues)` Called for each traversed `Enumeration` expression
    `T` | `visitLambdaExpression(String lambdaFunction, String lambdaVariable, Expression expression)` Called for each traversed lambda expression
    `T` | `visitLambdaReference(String variableName)` Called for each traversed `LambdaRef`
    `T` | `visitLiteral(Literal literal)` Called for each traversed `Literal` expression
    `T` | `visitMember(Member member)` Called for each traversed `Member` expression
    `T` | `visitMethodCall(MethodKind methodCall, List<T> parameters)` Called for each traversed `Method` expression
    `T` | `visitTypeLiteral(EdmType type)` Called for each traversed `TypeLiteral` expression
    `T` | `visitUnaryOperator(UnaryOperatorKind operator, T operand)` Called for each traversed `Unary` expression

- - ### Method Detail

    - #### visitBinaryOperator

          T visitBinaryOperator(BinaryOperatorKind operator,
                                T left,
                                T right)
                         throws ExpressionVisitException,
                                ODataApplicationException

      Called for each traversed `Binary` expression
      Parameters:
        `operator` - Operator kind
        `left` - Application return value of left sub tree
        `right` - Application return value of right sub tree
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitUnaryOperator

          T visitUnaryOperator(UnaryOperatorKind operator,
                               T operand)
                        throws ExpressionVisitException,
                               ODataApplicationException

      Called for each traversed `Unary` expression
      Parameters:
        `operator` - Operator kind
        `operand` - return value of sub tree
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitMethodCall

          T visitMethodCall(MethodKind methodCall,
                            List<T> parameters)
                     throws ExpressionVisitException,
                            ODataApplicationException

      Called for each traversed `Method` expression
      Parameters:
        `methodCall` - Method
        `parameters` - List of application return values created by visiting each method parameter
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occurred
        `ODataApplicationException` - Thrown by the application

    - #### visitLambdaExpression

          T visitLambdaExpression(String lambdaFunction,
                                  String lambdaVariable,
                                  Expression expression)
                           throws ExpressionVisitException,
                                  ODataApplicationException

      Called for each traversed lambda expression
      Parameters:
        `lambdaFunction` - "ALL" or "ANY"
        `lambdaVariable` - Variable name used lambda variable
        `expression` - Lambda expression
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitLiteral

          T visitLiteral(Literal literal)
                  throws ExpressionVisitException,
                         ODataApplicationException

      Called for each traversed `Literal` expression
      Parameters:
        `literal` - Literal
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitMember

          T visitMember(Member member)
                 throws ExpressionVisitException,
                        ODataApplicationException

      Called for each traversed `Member` expression
      Parameters:
        `member` - UriInfoResource object describing the whole path used to access an data value (this includes for example the usage of $root and $it inside the URI)
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitAlias

          T visitAlias(String aliasName)
                throws ExpressionVisitException,
                       ODataApplicationException

      Called for each traversed `Alias` expression
      Parameters:
        `aliasName` - Name of the alias
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitTypeLiteral

          T visitTypeLiteral(EdmType type)
                      throws ExpressionVisitException,
                             ODataApplicationException

      Called for each traversed `TypeLiteral` expression
      Parameters:
        `type` - EdmType
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitLambdaReference

          T visitLambdaReference(String variableName)
                          throws ExpressionVisitException,
                                 ODataApplicationException

      Called for each traversed `LambdaRef`
      Parameters:
        `variableName` - Name of the used lambda variable
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitEnum

          T visitEnum(EdmEnumType type,
                      List<String> enumValues)
               throws ExpressionVisitException,
                      ODataApplicationException

      Called for each traversed `Enumeration` expression
      Parameters:
        `type` - Type used in the URI before the enumeration values
        `enumValues` - List of enumeration values
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

    - #### visitBinaryOperator

          T visitBinaryOperator(BinaryOperatorKind operator,
                                T left,
                                List<T> right)
                         throws ExpressionVisitException,
                                ODataApplicationException

      Called for each traversed `Binary` expression
      Parameters:
        `operator` - Operator kind
        `left` - Application return value of left sub tree
        `right` - Application return value of right sub tree
      Returns:
        Application return value of type T
      Throws:
        `ExpressionVisitException` - Thrown if an exception while traversing occured
        `ODataApplicationException` - Thrown by the application

Copyright © 2013–2020 The Apache Software Foundation. All rights reserved.