Class ExpressionParserProxy

java.lang.Object
com.aquima.interactions.rule.parser.ExpressionParserProxy
All Implemented Interfaces:
IExpressionParser, Serializable
Direct Known Subclasses:
ReportingExpressionParser

public abstract class ExpressionParserProxy extends Object implements IExpressionParser
Expression parser base class containing the default implementations of the various parse methods. It proxies the com.aquima.interactions.expression parser to the rule engine interface.
Since:
5.0
Author:
O. Kerpershoek
See Also:
  • Constructor Details

    • ExpressionParserProxy

      public ExpressionParserProxy(IProject project, IMetaModel metamodel, IExprParser internalParser)
      Constructs the expression parser for the specified meta-model.
      Parameters:
      project - Project containing various global definitions.
      metamodel - The meta model which is used for TSL parsing for all languages.
      internalParser - The internal parser that should be used while parsing expressions.
  • Method Details

    • getUnitName

      protected abstract String getUnitName()
    • getParseListenerFor

      protected abstract IParseListener getParseListenerFor(String expression)
    • expressionFor

      public IExpression expressionFor(String expression)
      Description copied from interface: IExpressionParser
      Parses and optimizes the expression so one can evaluate this expression. A parsed expression is considered correct and should not fail during evaluation.
      Specified by:
      expressionFor in interface IExpressionParser
      Parameters:
      expression - The input expression
      Returns:
      an expression which is never null
    • typedExpressionFor

      public IExpression typedExpressionFor(String expression, String attribute)
      Description copied from interface: IExpressionParser
      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.
      Specified by:
      typedExpressionFor in interface IExpressionParser
      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
    • conditionFor

      public ICondition conditionFor(String expression)
      Description copied from interface: IExpressionParser
      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.
      Specified by:
      conditionFor in interface IExpressionParser
      Parameters:
      expression - The condition expression that should be parsed.
      Returns:
      Condition object for the expression.
    • parseTsl

      public IDynamicText parseTsl(IMultilingualText text)
      Description copied from interface: IExpressionParser
      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.
      Specified by:
      parseTsl in interface IExpressionParser
      Parameters:
      text - Text object that should be parsed.
      Returns:
      Dynamic text object for the passed text object.