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
RuleProviderevaluate in interface RuleProviderruleName - 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.SmooksExceptionpublic String getName()
RuleProvidergetName in interface RuleProviderpublic void setName(String name)
RuleProvidersetName in interface RuleProvidername - The rule providers name.public String getSrc()
RuleProvidergetSrc in interface RuleProviderpublic void setSrc(String src)
RuleProvidersetSrc in interface RuleProvidersrc - The source which defines the rules.protected void loadRules(String ruleFile)
ruleFile - The rule file path.Copyright © 2020. All rights reserved.