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 SummaryNested Classes Modifier and Type Class Description protected static classPerspectiveExpression.PerspectiveExpressionCommonContext
 - 
Field SummaryFields Modifier and Type Field Description protected static ELParserHarnessPARSER
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedPerspectiveExpression(BindingContext bindingContext, Expression expression, java.util.List<PropertyReference> references)
 - 
Method SummaryAll 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.java.util.Collection<PropertyReference>resolveReferences()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- 
PARSERprotected static final ELParserHarness PARSER 
 
- 
 - 
Constructor Detail- 
PerspectiveExpressionprotected PerspectiveExpression(BindingContext bindingContext, Expression expression, java.util.List<PropertyReference> references) - Parameters:
- bindingContext- The binding context
- expression- The expression to evaluate
 
 
- 
 - 
Method Detail- 
createpublic static PerspectiveExpression create(BindingContext context, java.lang.String source) throws ConfigurationException - Throws:
- ConfigurationException
 
 - 
executepublic QualifiedValue execute() throws ExpressionException Synchronously calls execute on the expression, on calling thread.- Throws:
- ExpressionException
 
 - 
resolveReferencespublic java.util.Collection<PropertyReference> resolveReferences() 
 - 
startuppublic void startup(java.util.function.Consumer<QualifiedValue> expressionValueCallback) 
 - 
startuppublic 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 returns- QualifiedValue.EXPRESSION_EVAL_ERROR
 
 - 
shutdownpublic void shutdown() 
 - 
childInteractionUpdatedpublic void childInteractionUpdated(java.util.List<java.lang.Object> sourceStack) - Specified by:
- childInteractionUpdatedin interface- ExpressionSourceStackMonitor
 
 - 
childInteractionUpdatedpublic void childInteractionUpdated() - Specified by:
- childInteractionUpdatedin interface- InteractionListener
 
 - 
evaluateExpressionpublic void evaluateExpression() Submits evaluation task to the executor
 
- 
 
-