Class AbstractMultiLevelExpressionParseContext

java.lang.Object
com.inductiveautomation.ignition.gateway.expressions.AbstractMultiLevelExpressionParseContext
All Implemented Interfaces:
ExpressionParseContext
Direct Known Subclasses:
AlarmEventCollectionExpressionParseContext, BeanStyleExpressionParseContext, PropertyBasedExpressionParseContext, ReportDataExpressionParseContext, SubqueryExpressionParseContext

public abstract class AbstractMultiLevelExpressionParseContext extends Object implements ExpressionParseContext
The foundation for an expression parse context that tries to create a reference, but then delegates if the reference isn't the type expected. Implemented in this way because ultimately a RuntimeException should be thrown if the reference can't be built. So, this implementation may not throw an error, but eventually one of the contexts up the chain will.

By default the base's function factory is used.

  • Constructor Details

    • AbstractMultiLevelExpressionParseContext

      public AbstractMultiLevelExpressionParseContext(ExpressionParseContext base)
  • Method Details

    • getDelegateParseContext

      protected ExpressionParseContext getDelegateParseContext()
      Returns the parse context that this one delegates to on failure to create a bound expression
    • getFunctionFactory

      public FunctionFactory getFunctionFactory()
      Specified by:
      getFunctionFactory in interface ExpressionParseContext
    • getBaseFunctionFactory

      protected FunctionFactory getBaseFunctionFactory()
      Sub classes do some strange things, this lets them get the base function factory
    • createBoundExpression

      public Expression createBoundExpression(String path) throws RuntimeException
      Description copied from interface: ExpressionParseContext
      Called to create expressions to represent bound elements, like:

       { path.to.something }
       
      Specified by:
      createBoundExpression in interface ExpressionParseContext
      Parameters:
      path - the text content inside the braces.
      Throws:
      RuntimeException - because the CUP parser doesn't have a throws on the function that calls this inside the parser
    • tryCreateBoundExpression

      protected abstract Expression tryCreateBoundExpression(String path)
      This function should create the expression if possible. If not, it should return null instead of throwing the error, in which case the parent parse context will be tried.