public class RegexRule extends AbstractRule
RegexRule is based on regex pattern. If pattern matches with the
processed fact (after a toString()), then its actions will be fired. | Constructor and Description |
|---|
RegexRule(String name,
String pattern)
Constructor with only name and pattern : no default rule and salience set
to -1.
|
RegexRule(String name,
String pattern,
int salience)
Full constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Object fact,
Report context)
Execute business logic, using specific
Rule implementation. |
protected ArrayList<String> |
getMatches(String string)
child class can't acceed
pattern. |
String |
toString() |
activate, addCommand, clearCommands, executeCommands, getCommands, getFact, getFollowing, getName, getPreceeding, getReport, getSalience, isActive, passivate, removeCommand, setFact, setFollowingRules, setPreceedingRules, setReportpublic RegexRule(String name, String pattern, int salience)
name - rule's namepattern - rule's match patternactions - to execute() when rule matchessalience - priority level ( -100 < salience > 100)protected ArrayList<String> getMatches(String string)
pattern.string - public void execute(Object fact, Report context)
RuleRule implementation. This
is the good place to call executeCommands().Copyright © 2012. All Rights Reserved.