Class Rule
java.lang.Object
org.openhab.core.voice.text.interpreter.rulebased.Rule
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.
- Author:
- Tilman Kamp - Initial contribution
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordContext for rule execution. -
Constructor Summary
ConstructorsConstructorDescriptionRule(Expression expression, AbstractRuleBasedInterpreter.ItemFilter itemFilter, boolean isForced, boolean isSilent) Constructs a new instance. -
Method Summary
Modifier and TypeMethodDescriptionabstract InterpretationResultinterpretAST(ResourceBundle language, ASTNode node, Rule.InterpretationContext context) Will get called after the expression was successfully parsed.
-
Constructor Details
-
Rule
public Rule(Expression expression, AbstractRuleBasedInterpreter.ItemFilter itemFilter, boolean isForced, boolean isSilent) Constructs a new instance.- Parameters:
expression- the expression that has to parse successfully, beforeinterpretAST(java.util.ResourceBundle, org.openhab.core.voice.text.interpreter.rulebased.ASTNode, org.openhab.core.voice.text.interpreter.rulebased.Rule.InterpretationContext)is calleditemFilter- Filters allowed items for rule.isSilent- Rule will emit no response on success.
-
-
Method Details
-
interpretAST
public abstract InterpretationResult interpretAST(ResourceBundle language, ASTNode node, Rule.InterpretationContext context) Will get called after the expression was successfully parsed.- Parameters:
language- a resource bundle that can be used for looking up common localized response phrasesnode- the resulting AST node of the parse run. To be used as input.context- for rule interpretation- Returns:
-
getExpression
- Returns:
- the expression
-