Class PerspectiveExpression
java.lang.Object
com.inductiveautomation.perspective.gateway.binding.PerspectiveExpression
- All Implemented Interfaces:
- InteractionListener,- ExpressionSourceStackMonitor
- Direct Known Subclasses:
- PerspectiveTransformExpression
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 SummaryNested ClassesModifier and TypeClassDescriptionprotected static class
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedPerspectiveExpression(BindingContext bindingContext, Expression expression, List<PropertyReference> references) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidchildInteractionUpdated(List<Object> sourceStack) static PerspectiveExpressioncreate(BindingContext context, String source) voidSubmits evaluation task to the executorexecute()Synchronously calls execute on the expression, on calling thread.voidshutdown()voidstartup(Consumer<QualifiedValue> expressionValueCallback) voidstartup(Consumer<QualifiedValue> expressionValueCallback, Function<ExpressionException, QualifiedValue> errorHandler) Connects and starts up the underlying expression.
- 
Field Details- 
PARSER
 
- 
- 
Constructor Details- 
PerspectiveExpressionprotected PerspectiveExpression(BindingContext bindingContext, Expression expression, List<PropertyReference> references) - Parameters:
- bindingContext- The binding context
- expression- The expression to evaluate
 
 
- 
- 
Method Details- 
createpublic static PerspectiveExpression create(BindingContext context, String source) throws ConfigurationException - Throws:
- ConfigurationException
 
- 
executeSynchronously calls execute on the expression, on calling thread.- Throws:
- ExpressionException
 
- 
resolveReferences
- 
startup
- 
startuppublic void startup(Consumer<QualifiedValue> expressionValueCallback, 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 returns- QualifiedValue.EXPRESSION_EVAL_ERROR
 
- 
shutdownpublic void shutdown()
- 
childInteractionUpdated- Specified by:
- childInteractionUpdatedin interface- ExpressionSourceStackMonitor
 
- 
childInteractionUpdatedpublic void childInteractionUpdated()- Specified by:
- childInteractionUpdatedin interface- InteractionListener
 
- 
evaluateExpressionpublic void evaluateExpression()Submits evaluation task to the executor
 
-