Interface Evaluator

  • All Known Subinterfaces:
    BinaryEvaluator

    @OpenApi
    public interface Evaluator
    A basic expression evaluator interface. Implementers should realize the method to evaluate expression
    • Method Detail

      • evaluate

        @OpenApi
        java.lang.Object evaluate​(OpaqueExpression expression,
                                  @CheckForNull
                                  Element object)
        Entry method for expression evaluation. Takes expression, contextual object and produces result.
        Parameters:
        expression - expression to be called
        object - contextual object of expression call
        Returns:
        expression evaluation result
      • evaluate

        @OpenApi
        default java.lang.Object evaluate​(OpaqueExpression expression,
                                          @CheckForNull
                                          Element object,
                                          java.util.List<NamedArgument> arguments)
        Entry method for expression evaluation. Takes expression, contextual object, additional arguments and produces result.
        Parameters:
        expression - expression to be called
        object - contextual object of expression call
        Returns:
        expression evaluation result
      • isExpressionGlobal

        @OpenApi
        boolean isExpressionGlobal​(OpaqueExpression expression)
        Determines if the supplied expression is "global", i.e. if it needs contextual object to be evaluated. If expression does not need contextual object, then this expression is considered to be "global" or "static"
        Parameters:
        expression - expression to be inspected
        Returns:
        true if expression does not need the contextual object
      • getExpressionCachingKey

        @OpenApi
        java.lang.String getExpressionCachingKey​(OpaqueExpression expression)
        Calculates a string identifier of the expression. Expression evaluation results of objects are cached under this key return null if result should not be cached.
        Parameters:
        expression - expression, results of which are to be cached
        Returns:
        identifier of the expression