Interface IExpressionParser

All Superinterfaces:
Serializable
All Known Implementing Classes:
ExpressionParserProxy, ReportingExpressionParser

public interface IExpressionParser extends Serializable
Parses an expression to an optimized structure which can be evaluated.
Since:
5.0
Author:
O. Kerpershoek, F. van der Meer
  • Method Details

    • expressionFor

      IExpression expressionFor(String expression)
      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

      IExpression typedExpressionFor(String expression, String attribute)
      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 expression
      attribute - 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

      ICondition conditionFor(String expression)
      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.