public class RegexProvider extends Object implements RuleProvider
Constructor and Description |
---|
RegexProvider()
No-args constructor required by Smooks.
|
RegexProvider(String src)
Constructor which accepts a source regex file.
|
Modifier and Type | Method and Description |
---|---|
RuleEvalResult |
evaluate(String ruleName,
CharSequence selectedData,
ExecutionContext context)
Evalutate the rule.
|
String |
getName()
Gets this providers name.
|
String |
getSrc()
Gets the source for this rule provider
|
protected void |
loadRules(String ruleFile)
Load the regex rule from the specified rule file.
|
void |
setName(String name)
The name of this rule provider.
|
void |
setSrc(String src)
Sets the src for this rule provider.
|
public RegexProvider()
public RegexProvider(String src)
src
- The name/path of the properties file containing the reqular expressions.public RuleEvalResult evaluate(String ruleName, CharSequence selectedData, ExecutionContext context) throws SmooksException
RuleProvider
evaluate
in interface RuleProvider
ruleName
- The ruleName to be used in this evaluation.selectedData
- The data that this evalute method will evaluate upon.context
- The Smooks Excecution context.RuleEvalResult
Object representing an evaluation result.SmooksException
public String getName()
RuleProvider
getName
in interface RuleProvider
public void setName(String name)
RuleProvider
setName
in interface RuleProvider
name
- The rule providers name.public String getSrc()
RuleProvider
getSrc
in interface RuleProvider
public void setSrc(String src)
RuleProvider
setSrc
in interface RuleProvider
src
- The source which defines the rules.protected void loadRules(String ruleFile)
ruleFile
- The rule file path.Copyright © 2020. All rights reserved.