Package com.aquima.interactions.rule
Interface IExpressionParser
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ExpressionParserProxy
,ReportingExpressionParser
Parses an expression to an optimized structure which can be evaluated.
- Since:
- 5.0
- Author:
- O. Kerpershoek, F. van der Meer
-
Method Summary
Modifier and TypeMethodDescriptionconditionFor
(String expression) This method will parse the expression to a condition object.expressionFor
(String expression) Parses and optimizes the expression so one can evaluate this expression.parseTsl
(IMultilingualText text) This method will parse the text object and convert it to a dynamic text object.typedExpressionFor
(String expression, String attribute) Parses and optimizes the expression so one can evaluate this expression.
-
Method Details
-
expressionFor
Parses and optimizes the expression so one can evaluate this expression. A parsed expression is considered correct and should not fail during evaluation.- Parameters:
expression
- The input expression- Returns:
- an expression which is never null
- Throws:
RuleEngineParseException
- This exception is thrown when the expression is invalid.- Since:
- 5.0
-
typedExpressionFor
Parses and optimizes the expression so one can evaluate this expression. A parsed expression is considered correct and should not fail during evaluation. This parse method will ensure the result of the expression when evaluated matches the type provided as argument of this method.- Parameters:
expression
- The input expressionattribute
- The name of the attribute whose type the expression result should be converted to.- Returns:
- an expression which is never null
- Throws:
RuleEngineParseException
- This exception is thrown when the expression is invalid.UnknownEntityException
- This exception is thrown when the attribute could not be found.UnknownAttributeException
- This exception is thrown when the attribute references an unknown entity.- Since:
- 6.1
-
conditionFor
This method will parse the expression to a condition object. Although quite similar to the 'expressionFor' method, this method will also verify that the result of the expression is always a boolean type.- Parameters:
expression
- The condition expression that should be parsed.- Returns:
- Condition object for the expression.
- Throws:
RuleEngineParseException
- This exception is thrown when the condition is invalid.
-
parseTsl
This method will parse the text object and convert it to a dynamic text object. When the text object passed to this method does not contain any TSL statement, a dynamic text object will still be returned, but the evaluation of the dynamic text will always yield the same results.- Parameters:
text
- Text object that should be parsed.- Returns:
- Dynamic text object for the passed text object.
- Throws:
RuleEngineException
- This exception is thrown when the text is invalid.
-