@NonNullByDefault public abstract class Rule extends Object
Represents an expression plus action code that will be executed after successful parsing. This class is immutable and deriving classes should conform to this principle.
- Tilman Kamp - Initial contribution
Nested Class SummaryModifier and TypeClassDescription
static final recordContext for rule execution.
RuleConstructs a new instance.
expression- the expression that has to parse successfully, before
interpretAST(java.util.ResourceBundle, org.openhab.core.voice.text.ASTNode, org.openhab.core.voice.text.Rule.InterpretationContext)is called
allowedItemNames- List of allowed items or empty for disabled.
interpretASTpublic abstract InterpretationResult interpretAST
(ResourceBundle language, ASTNode node, Rule.InterpretationContext context)Will get called after the expression was successfully parsed.
language- a resource bundle that can be used for looking up common localized response phrases
node- the resulting AST node of the parse run. To be used as input.
context- for rule interpretation
getExpressionpublic Expression getExpression()
- the expression