Class ExpressionFixer
- java.lang.Object
-
- com.aquima.interactions.expressions.ExpressionFixer
-
public class ExpressionFixer extends Object
This class rewrites decision condition alternative expressions to full expressions which are parsable by the 4.2 expression parser.- Since:
- 5.0
- Author:
- O. Kerpershoek, F. van der Meer
-
-
Constructor Summary
Constructors Constructor Description ExpressionFixer(boolean useBexprOpr)
Constructs the decision table expression fixer with a boolean indicating if the expressions should be fixed for a release 4 parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
indexOfDeclarationEnd(String expression)
String
parse(String lhs, String expression)
This method rewrites a 4.2 syntax expression used in decision tables, to an expression that is valid in the 5.0 syntax.String
parseWithDeclarations(String lhs, String expression)
-
-
-
Constructor Detail
-
ExpressionFixer
public ExpressionFixer(boolean useBexprOpr)
Constructs the decision table expression fixer with a boolean indicating if the expressions should be fixed for a release 4 parser. As the release 4 parser does not allow a compare (=, !=) between boolean expressions, a special keyword (BEQ, BNE) is used for these type of comparisons.- Parameters:
useBexprOpr
- Boolean indicating if expressions should be fixed for a release 4 parser.
-
-
Method Detail
-
parse
public String parse(String lhs, String expression)
This method rewrites a 4.2 syntax expression used in decision tables, to an expression that is valid in the 5.0 syntax. The 4.2 syntax allows for incomplete expressions to be evaluated with a left-hand-side value, which is inserted at 'appropriate' points in the expression.
For example: The expression '< 4 AND > 7' with an LHS value of 'X', will be rewritten to the expression 'X < 4 AND X > 7'- Parameters:
lhs
- The left-hand-side value which should be used in the partial 4.2 expression.expression
- The partial 4.2 expression that needs to be rewritten.- Returns:
- Complete expression combining the LHS value and the partial expression.
-
-