public interface ExpressionEvaluator
T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Modifier and Type | Method and Description |
---|---|
Object |
evaluateNumericExpression(String expression,
Class resultType)
Evaluate an expression and return the result of the requested result
type.
|
Object |
evaluateNumericExpression(String expression,
Class resultType,
ScriptingContext context)
Evaluate an expression and return the result of the requested result
type.
|
String |
fixForCondition(String expression,
String forVariableName,
ScriptingContext context)
Fix improper variable calls in a condition which is to be processed using
the 'for' statement.
|
String |
fixIfCondition(String expression,
ScriptingContext context)
Fix improper variable calls in a condition which is to be processed using
the 'if' statement.
|
boolean |
isLegacy()
Indicate whether the back end parser is the legacy one.
|
Object evaluateNumericExpression(String expression, Class resultType)
IllegalArgumentException
.expression
- an expression such as "1+1" or "5==3 || 3>2".resultType
- the target result type. If Boolean.class is passed the
expression will be evaluated as a boolean expression. Otherwise the
method must return the numeric return type, for example Double.class or
Integer.class.Object evaluateNumericExpression(String expression, Class resultType, ScriptingContext context)
IllegalArgumentException
.expression
- an expression such as "1+1" or "5==3 || 3>2".resultType
- the target result type. If Boolean.class is passed the
expression will be evaluated as a boolean expression. Otherwise the
method must return the numeric return type, for example Double.class or
Integer.class.context
- the script context. It is used for certain operators such
as 'exists [variable]'.String fixIfCondition(String expression, ScriptingContext context)
expression
- an expression.context
- the script context.String fixForCondition(String expression, String forVariableName, ScriptingContext context)
expression
- an expression.forVariableName
- optional name of the variable the 'for' loop
iterates on.context
- the script context.boolean isLegacy()