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:
- ExpressionDrivenStringValue
 
 public abstract class ExpressionDrivenValue<T> extends LockGuardedDrivenValue<T> An ExpressionDrivenValue is aLockGuardedDrivenValuedriven by aPerspectiveExpression. The injectedvalueChangedCallbackis called by aThreadholding 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 SummaryFields Modifier and Type Field Description protected booleandirtyprotected QualifiedValuevalue- 
Fields inherited from class com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValuelock
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedExpressionDrivenValue(java.lang.Object lock, PerspectiveExpression expr, java.lang.Runnable valueChangedCallback)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.util.Optional<T>getAndClear()Fetch the current driven valueprotected booleanisDirtyInternal()Called after asserting that the calling thread holds the injected lock.protected booleanisReadyInternal()Called 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 java.util.Collection<PropertyReference>resolveReferencesInternal()voidshutdown()Lifecycle hook to shut down the driven valuevoidstartup()Lifecycle hook to start up the driven value- 
Methods inherited from class com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValuegetAndClearInternal, isDirty, isReady, resolveReferences
 
- 
 
- 
- 
- 
Field Detail- 
valueprotected QualifiedValue value 
 - 
dirtyprotected boolean dirty 
 
- 
 - 
Constructor Detail- 
ExpressionDrivenValueprotected ExpressionDrivenValue(@Nonnull java.lang.Object lock, @Nonnull PerspectiveExpression expr, @Nonnull java.lang.Runnable valueChangedCallback)
 
- 
 - 
Method Detail- 
isValidValueprotected abstract boolean isValidValue(QualifiedValue value) This 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:
- LockGuardedDrivenValue.isReady()
 
 - 
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:
- LockGuardedDrivenValue.isDirty()
 
 - 
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
 - 
resolveReferencesInternalprotected java.util.Collection<PropertyReference> resolveReferencesInternal() - Specified by:
- resolveReferencesInternalin class- LockGuardedDrivenValue<T>
 
 - 
getAndClear@Nonnull public java.util.Optional<T> getAndClear() Description 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.
 
 
- 
 
-