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 java.lang.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 Summary
Constructors Constructor Description AbstractMultiLevelExpressionParseContext(ExpressionParseContext base)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ExpressioncreateBoundExpression(java.lang.String path)Called to create expressions to represent bound elements, like:protected FunctionFactorygetBaseFunctionFactory()Sub classes do some strange things, this lets them get the base function factoryprotected ExpressionParseContextgetDelegateParseContext()Returns the parse context that this one delegates to on failure to create a bound expressionFunctionFactorygetFunctionFactory()protected abstract ExpressiontryCreateBoundExpression(java.lang.String path)This function should create the expression if possible.
-
-
-
Constructor Detail
-
AbstractMultiLevelExpressionParseContext
public AbstractMultiLevelExpressionParseContext(ExpressionParseContext base)
-
-
Method Detail
-
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:
getFunctionFactoryin interfaceExpressionParseContext
-
getBaseFunctionFactory
protected FunctionFactory getBaseFunctionFactory()
Sub classes do some strange things, this lets them get the base function factory
-
createBoundExpression
public Expression createBoundExpression(java.lang.String path) throws java.lang.RuntimeException
Description copied from interface:ExpressionParseContextCalled to create expressions to represent bound elements, like:{ path.to.something }- Specified by:
createBoundExpressionin interfaceExpressionParseContext- Parameters:
path- the text content inside the braces.- Throws:
java.lang.RuntimeException- because the CUP parser doesn't have a throws on the function that calls this inside the parser
-
tryCreateBoundExpression
protected abstract Expression tryCreateBoundExpression(java.lang.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.
-
-