Class ExpressionDrivenStringValue
- java.lang.Object
-
- com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValue<T>
-
- com.inductiveautomation.perspective.gateway.driven.ExpressionDrivenValue<java.lang.String>
-
- com.inductiveautomation.perspective.gateway.driven.ExpressionDrivenStringValue
-
- All Implemented Interfaces:
DrivenValue<java.lang.String>
public class ExpressionDrivenStringValue extends ExpressionDrivenValue<java.lang.String>
An ExpressionDrivenStringValue is aExpressionDrivenValue
with typeString
. Calls toisValidValue(QualifiedValue)
will always return true since the emitted expression values will be coerced to a String.- See Also:
TypeUtilities.toString(Object)
-
-
Field Summary
-
Fields inherited from class com.inductiveautomation.perspective.gateway.driven.ExpressionDrivenValue
dirty, value
-
Fields inherited from class com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValue
lock
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExpressionDrivenStringValue(java.lang.Object lock, PerspectiveExpression expr, java.lang.Runnable valueChangedCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<java.lang.String>
getAndClearInternal()
Called after asserting that the calling thread holds the injected lock.protected boolean
isValidValue(QualifiedValue value)
This method is called when a new value is emitted from the expression.-
Methods inherited from class com.inductiveautomation.perspective.gateway.driven.ExpressionDrivenValue
getAndClear, isDirtyInternal, isReadyInternal, shutdown, startup
-
Methods inherited from class com.inductiveautomation.perspective.gateway.driven.LockGuardedDrivenValue
isDirty, isReady
-
-
-
-
Constructor Detail
-
ExpressionDrivenStringValue
protected ExpressionDrivenStringValue(@Nonnull java.lang.Object lock, @Nonnull PerspectiveExpression expr, @Nonnull java.lang.Runnable valueChangedCallback)
-
-
Method Detail
-
isValidValue
protected boolean isValidValue(QualifiedValue value)
Description copied from class:ExpressionDrivenValue
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.- Specified by:
isValidValue
in classExpressionDrivenValue<java.lang.String>
- Parameters:
value
- the latest value emitted from the expression- Returns:
- true if the value passes validation, false otherwise
-
getAndClearInternal
@Nonnull protected java.util.Optional<java.lang.String> getAndClearInternal()
Description copied from class:LockGuardedDrivenValue
Called after asserting that the calling thread holds the injected lock.- Specified by:
getAndClearInternal
in classLockGuardedDrivenValue<java.lang.String>
- See Also:
LockGuardedDrivenValue.getAndClear()
-
-