All Known Implementing Classes:
AbstractAlertExpressionContext.AlertVariableExpression, AbstractExpression, AlarmEventPropertyExpression, ArithmeticExpression, BitwiseExpression, BitwiseNot, BoundPropertyExpression, BoundPropertyExpression, BoundTagExpression, BoundVariableExpression, ComparisonExpression, ConstantExpression, EqualityExpression, FormattedExpression, FunctionExpression, LikeExpression, LocaleAwareMessageParseContext.LocaleStringExpression, LogicalExpression, NonLocalizedToStringExpression, NotExpression, PropertyBasedExpressionParseContext.PropertyReferenceExpression, SubscriptExpression, TagPathReadExpression, TagReferenceBinder.SubscribedTagExpression, TagReferenceBinder.TagReadExpression, ToStringExpression, UMinusExpression

public interface Expression
An expression is something that can be executed to compute a result. Each instance of expression is typically some node in what amounts to a parse tree. Many expressions such as operators and function calls have child expressions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    connect(CommonContext context, InteractionListener updateListener)
    Gives the expression a chance to connect itself to things, if necessary.
    void
    Tells the expression to disconnect from anything it was connected to.
    Compute and return the value of this expression.
    The children (if any) that this expression is dependent on for its execution.
    Return a human-readable name for the operation that this expression performs.
    default Class<?>
    Return the type that this expression will return.
    void
    Tells the expression to shutdown any polling operations.
    void
    Tells the expression to startup any polling operations.
  • Method Details

    • execute

      @NonNull QualifiedValue execute() throws ExpressionException
      Compute and return the value of this expression.
      Returns:
      the result of the expression evaluation as a QualifiedValue
      Throws:
      ExpressionException - if an error occurs during execution
    • getType

      default Class<?> getType()
      Return the type that this expression will return.
      Returns:
      the Class of the value returned by execute()
    • getOpName

      String getOpName()
      Return a human-readable name for the operation that this expression performs.
      Returns:
      the operation name
    • getChildren

      Expression[] getChildren()
      The children (if any) that this expression is dependent on for its execution.
      Returns:
      an array of child Expressions, or an empty array if no children exist
    • connect

      void connect(CommonContext context, InteractionListener updateListener)
      Gives the expression a chance to connect itself to things, if necessary. Most expressions do not have any connections. An expression should notify the updateListener if they change.
      Parameters:
      context - the CommonContext used to look up external resources
      updateListener - the InteractionListener to notify when the expression value changes
    • disconnect

      void disconnect()
      Tells the expression to disconnect from anything it was connected to.
    • startup

      void startup()
      Tells the expression to startup any polling operations. Expressions that use this can remember the updateListener from connect() to feed update notification to.
    • shutdown

      void shutdown()
      Tells the expression to shutdown any polling operations.