Class PerspectiveExpression
- java.lang.Object
 - 
- com.inductiveautomation.perspective.gateway.binding.PerspectiveExpression
 
 
- 
- All Implemented Interfaces:
 InteractionListener,ExpressionSourceStackMonitor
- Direct Known Subclasses:
 PerspectiveTransformExpression
public class PerspectiveExpression extends java.lang.Object implements ExpressionSourceStackMonitor
Helper class that simplifies the creation and proper evaluation of expressions that execute in and around the binding / transform system.Also simplifies the lifecycle so the user doesn't need to worry about the difference between startup/shutdown and connect/disconnect
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classPerspectiveExpression.PerspectiveExpressionCommonContext 
- 
Field Summary
Fields Modifier and Type Field Description protected static ELParserHarnessPARSER 
- 
Constructor Summary
Constructors Modifier Constructor Description protectedPerspectiveExpression(BindingContext bindingContext, Expression expression) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchildInteractionUpdated()voidchildInteractionUpdated(java.util.List<java.lang.Object> sourceStack)static PerspectiveExpressioncreate(BindingContext context, java.lang.String source)voidevaluateExpression()Submits evaluation task to the executorQualifiedValueexecute()Synchronously calls execute on the expression, on calling thread.voidshutdown()voidstartup(java.util.function.Consumer<QualifiedValue> expressionValueCallback)voidstartup(java.util.function.Consumer<QualifiedValue> expressionValueCallback, java.util.function.Function<ExpressionException,QualifiedValue> errorHandler)Connects and starts up the underlying expression. 
 - 
 
- 
- 
Field Detail
- 
PARSER
protected static final ELParserHarness PARSER
 
 - 
 
- 
Constructor Detail
- 
PerspectiveExpression
protected PerspectiveExpression(BindingContext bindingContext, Expression expression)
- Parameters:
 bindingContext- The binding contextexpression- The expression to evaluate
 
 - 
 
- 
Method Detail
- 
create
public static PerspectiveExpression create(BindingContext context, java.lang.String source) throws ConfigurationException
- Throws:
 ConfigurationException
 
- 
execute
public QualifiedValue execute() throws ExpressionException
Synchronously calls execute on the expression, on calling thread.- Throws:
 ExpressionException
 
- 
startup
public void startup(java.util.function.Consumer<QualifiedValue> expressionValueCallback)
 
- 
startup
public void startup(java.util.function.Consumer<QualifiedValue> expressionValueCallback, java.util.function.Function<ExpressionException,QualifiedValue> errorHandler)
Connects and starts up the underlying expression.- Parameters:
 expressionValueCallback- Callback that will be invoked when the expression produces a value. Will be called at least once, meaning that the initial value will be produced immediately.errorHandler- Will be invoked if the expression throws, must create a qualified value to use. Single-arg constructor just returnsQualifiedValue.EXPRESSION_EVAL_ERROR
 
- 
shutdown
public void shutdown()
 
- 
childInteractionUpdated
public void childInteractionUpdated(java.util.List<java.lang.Object> sourceStack)
- Specified by:
 childInteractionUpdatedin interfaceExpressionSourceStackMonitor
 
- 
childInteractionUpdated
public void childInteractionUpdated()
- Specified by:
 childInteractionUpdatedin interfaceInteractionListener
 
- 
evaluateExpression
public void evaluateExpression()
Submits evaluation task to the executor 
 - 
 
 -