Class ExpressionHelper


  • @OpenApiAll
    public class ExpressionHelper
    extends java.lang.Object
    Various utility methods used for ParameterizedExpression.
    • Constructor Detail

      • ExpressionHelper

        public ExpressionHelper()
    • Method Detail

      • call

        @CheckForNull
        public static java.lang.Object call​(ParameterizedExpression expression,
                                            java.lang.Object... arguments)
                                     throws java.lang.Exception
        Simplified ParametrizedExpression call. Intended for easier usage from scripts. ValueContext is null.
        Parameters:
        expression - expression to call. If not ParametrizedExpression result will be null
        arguments - arguments for the expression
        Returns:
        expression result
        Throws:
        java.lang.Exception - various exceptions, mostly from java.lang.reflect.Method#invoke(java.lang.Object, java.lang.Object...)
      • call

        @CheckForNull
        public static java.lang.Object call​(ParameterizedExpression parameterizedExpression,
                                            @CheckForNull
                                            java.util.List<?> arguments,
                                            @CheckForNull
                                            ValueContext valueContext)
                                     throws java.lang.Exception
        Call parameterizedExpression and returns value.
        Parameters:
        parameterizedExpression - expression which should be called
        arguments - arguments for the expression. If arguments do ot match, then exception will be thrown
        valueContext - value context for the evaluated value. Usually null
        Returns:
        value of the expression call
        Throws:
        java.lang.Exception - various exceptions, mostly from java.lang.reflect.Method#invoke(java.lang.Object, java.lang.Object...)
      • getBehaviorExpression

        @CheckForNull
        public static ParameterizedExpression getBehaviorExpression​(Behavior behavior)
        Gets expression represented by a given behavior.
        Parameters:
        behavior - behavior which represents an expression.
        Returns:
        parameterized expression.