Package com.helixframework.rules.config
Class YamlRulesFactory
java.lang.Object
com.helixframework.rules.config.YamlRulesFactory
Loads rules from a yaml configuration file.
Expected file format:
- name: ruleA
type: spel
classification: foo
description: "Appends an 'A' to the string"
dependencies:
- ruleB
- ruleD
expression:
"#root.concat('A')"
tags:
fooTag: fooTagValue
timeout: 1000
- name: ruleB
type: spel
classification: foo
description: "Appends a 'B' to the string"
dependencies:
- ruleC
expression:
"#root.concat('B')"
tags:
fooTag: fooTagValue
barTag: barTagValue
- name: ruleC
type: spel
classification: bar
description: "Appends a 'C' to the string"
expression:
"#root.concat('C')"
- name: ruleD
type: java
classification: baz
description: "Appends a 'D' to the string"
className: com.helixframework.rules.config.rules.RuleD
-
Method Summary
Modifier and TypeMethodDescriptionLoads rules from the supplied file.load(InputStream inputStream) Loads rules from the supplied input stream.Loads rules from the file path.Loads rules from the file path.
-
Method Details
-
load
Loads rules from the file path.- Parameters:
filePath- file path- Returns:
- a set of
Rule - Throws:
IOException- if file cannot be read
-
load
Loads rules from the file path.- Parameters:
filePath- file path- Returns:
- a set of
Rule - Throws:
IOException- if file cannot be read
-
load
Loads rules from the supplied file.- Parameters:
file- file- Returns:
- a set of
Rule - Throws:
IOException- if file cannot be read
-
load
Loads rules from the supplied input stream.- Parameters:
inputStream- input stream- Returns:
- a set of
Rule - Throws:
IOException- if inputstream cannot be read
-