Class TagReferenceBinder
java.lang.Object
com.inductiveautomation.ignition.gateway.expressions.TagReferenceBinder
- All Implemented Interfaces:
ExpressionParseContext
- Direct Known Subclasses:
TagReferenceBinder.ReadBinder
,TagReferenceBinder.SubscribedBinder
The TagReferenceBinder is a parse context that looks for references to tags, and possibly properties. There are three
possible binder types: Subscribed, and Read, and Subscribed Prop or Tag, created with the new{Type}Binder()
functions.
The subscribed binder will subscribe to tags it encounters and fire interaction events when the values change. The read binder will read the tag values when executed, but will not know when they change otherwise.
The prop or tag binder will try to determine if the reference is to a property or a tag, based on syntax. For a tag reference to be created in this case, the path must be "this" or start with "[source]" (relative source is fine).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
protected static class
protected static class
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TagReferenceBinder
(ObservablePropertySource propSource, FunctionFactory funcFactory, TagPath basePath) protected
TagReferenceBinder
(FunctionFactory funcFactory, TagPath basePath) protected
TagReferenceBinder
(FunctionFactory funFact, Supplier<String> defaultProvider) -
Method Summary
Modifier and TypeMethodDescriptioncreateBoundExpression
(String path) Called to create expressions to represent bound elements, like:protected LoggerEx
protected Expression
instantiatePropertyExpression
(Property<?> prop) protected abstract Expression
instantiateTagExpression
(TagPath path, boolean selfRef) protected boolean
protected boolean
static TagReferenceBinder
newReadBinder
(FunctionFactory funFact, Supplier<String> defaultProvider) static TagReferenceBinder
newReadBinder
(TagPath basePath, FunctionFactory funcFactory) static TagReferenceBinder
newSubscribedBinder
(TagPath basePath, FunctionFactory funcFactory) Returns a reference binder that subscribes to tag paths inside of it.static TagReferenceBinder
newTagOrPropertyBinder
(ObservablePropertySource properties, TagPath basePath, FunctionFactory funcFactory) void
setThrowExceptionOnParseError
(boolean throwExceptionOnParseError)
-
Constructor Details
-
TagReferenceBinder
protected TagReferenceBinder(ObservablePropertySource propSource, FunctionFactory funcFactory, TagPath basePath) -
TagReferenceBinder
-
TagReferenceBinder
-
-
Method Details
-
newTagOrPropertyBinder
public static TagReferenceBinder newTagOrPropertyBinder(ObservablePropertySource properties, TagPath basePath, FunctionFactory funcFactory) -
newSubscribedBinder
Returns a reference binder that subscribes to tag paths inside of it. -
newReadBinder
-
newReadBinder
public static TagReferenceBinder newReadBinder(FunctionFactory funFact, Supplier<String> defaultProvider) -
getLogger
-
getFunctionFactory
- Specified by:
getFunctionFactory
in interfaceExpressionParseContext
-
instantiatePropertyExpression
-
instantiateTagExpression
-
isThis
-
isTag
-
createBoundExpression
Description copied from interface:ExpressionParseContext
Called to create expressions to represent bound elements, like:{ path.to.something }
- Specified by:
createBoundExpression
in interfaceExpressionParseContext
- Parameters:
path
- the text content inside the braces.- Throws:
RuntimeException
- because the CUP parser doesn't have a throws on the function that calls this inside the parser
-
setThrowExceptionOnParseError
public void setThrowExceptionOnParseError(boolean throwExceptionOnParseError)
-