Class ExpressionDrivenValue<T>
java.lang.Object
com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValue<T>
com.inductiveautomation.perspective.gateway.driven.ExpressionDrivenValue<T>
- Type Parameters:
- T- The type of the driven value
- All Implemented Interfaces:
- DrivenValue<T>
- Direct Known Subclasses:
- ExpressionDrivenQualifiedValue,- ExpressionDrivenStringValue
An ExpressionDrivenValue is a 
LockGuardedDrivenValue driven by a PerspectiveExpression. The
 injected valueChangedCallback is called by a Thread holding the injected lock object when
 a new value is emitted from the expression and it passes validation. Derived classes get to decide what passing
 validation means.- 
Field SummaryFieldsFields inherited from class com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValuelock
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedExpressionDrivenValue(Object lock, PerspectiveExpression expr, Runnable valueChangedCallback) 
- 
Method SummaryModifier and TypeMethodDescriptionFetch the current driven valueprotected booleanCalled after asserting that the calling thread holds the injected lock.protected booleanCalled after asserting that the calling thread holds the injected lock.protected abstract booleanisValidValue(QualifiedValue value) This method is called when a new value is emitted from the expression.protected Collection<PropertyReference>voidshutdown()Lifecycle hook to shut down the driven valuevoidstartup()Lifecycle hook to start up the driven valueMethods inherited from class com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValuegetAndClearInternal, isDirty, isReady, resolveReferences
- 
Field Details- 
value
- 
dirtyprotected boolean dirty
 
- 
- 
Constructor Details- 
ExpressionDrivenValueprotected ExpressionDrivenValue(@Nonnull Object lock, @Nonnull PerspectiveExpression expr, @Nonnull Runnable valueChangedCallback) 
 
- 
- 
Method Details- 
isValidValueThis method is called when a new value is emitted from the expression. If the value passes validation, the value is set, dirty bits are set, and the callback is notified. If the value does not pass validation, nothing happens and a debug message is logged.- Parameters:
- value- the latest value emitted from the expression
- Returns:
- true if the value passes validation, false otherwise
 
- 
isReadyInternalprotected boolean isReadyInternal()Description copied from class:LockGuardedDrivenValueCalled after asserting that the calling thread holds the injected lock.- Specified by:
- isReadyInternalin class- LockGuardedDrivenValue<T>
- See Also:
 
- 
isDirtyInternalprotected boolean isDirtyInternal()Description copied from class:LockGuardedDrivenValueCalled after asserting that the calling thread holds the injected lock.- Specified by:
- isDirtyInternalin class- LockGuardedDrivenValue<T>
- See Also:
 
- 
startuppublic void startup()Description copied from interface:DrivenValueLifecycle hook to start up the driven value
- 
shutdownpublic void shutdown()Description copied from interface:DrivenValueLifecycle hook to shut down the driven value
- 
resolveReferencesInternal- Specified by:
- resolveReferencesInternalin class- LockGuardedDrivenValue<T>
 
- 
getAndClearDescription copied from interface:DrivenValueFetch the current driven value- Specified by:
- getAndClearin interface- DrivenValue<T>
- Overrides:
- getAndClearin class- LockGuardedDrivenValue<T>
- Returns:
- An Optionalcontaining the current driven value, if present, or an empty Optional if the driven value is null / not present.
 
 
-