Interface IExpression

All Superinterfaces:
Serializable
All Known Subinterfaces:
ICondition
All Known Implementing Classes:
BooleanCondition, Condition, Expression

public interface IExpression extends Serializable
This interface represents a (parsed) expression which can be evaluated with a valid inference context. A Parsed expression is considered correct and should not fail during evaluation.
Since:
5.0
Author:
O. Kerpershoek, F. van der Meer
  • Method Summary

    Modifier and Type
    Method
    Description
    This method will evaluate the expression and return the result as a value object.
    This method will return the expected output data type of the expression.
    This method return the original (unparsed) expression.
    Returns a list of the entity names which could be used as root scope during expression evaluation.
    boolean
    Returns whether the output of the expression is a list.
  • Method Details

    • getExpression

      String getExpression()
      This method return the original (unparsed) expression.
      Returns:
      String containing the original expression.
    • getScopeObjects

      String[] getScopeObjects()
      Returns a list of the entity names which could be used as root scope during expression evaluation. This does not necessarily mean these scope objects will be used. All returned scope objects are lowercase, since the expression evaluator is case-insensitive it sees them as lowercase.
      Returns:
      Never null
    • evaluateWith

      IValue evaluateWith(InferenceContext context)
      This method will evaluate the expression and return the result as a value object.
      Parameters:
      context - object containing the objects that are visible for the expression.
      Returns:
      Value object with the result of the expression.
      Throws:
      RuleEngineException - This exception is thrown when the expression could not be evaluated.
    • getDataType

      DataType getDataType()
      This method will return the expected output data type of the expression. Never null but in some cases it can be DataType.ANY if it is unknown.
      Returns:
      DataType
    • isMultivalue

      boolean isMultivalue()
      Returns whether the output of the expression is a list.
      Returns:
      boolean