org.milyn.rules.regex
Class RegexProvider

java.lang.Object
  extended by org.milyn.rules.regex.RegexProvider
All Implemented Interfaces:
RuleProvider

public class RegexProvider
extends Object
implements RuleProvider

Regex Rule Provider.

Author:
Daniel Bevenius

Constructor Summary
RegexProvider()
          No-args constructor required by Smooks.
RegexProvider(String src)
          Constructor which accepts a source regex file.
 
Method Summary
 RuleEvalResult evaluate(String ruleName, CharSequence selectedData, org.milyn.container.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegexProvider

public RegexProvider()
No-args constructor required by Smooks.


RegexProvider

public RegexProvider(String src)
Constructor which accepts a source regex file.

Parameters:
src - The name/path of the properties file containing the reqular expressions.
Method Detail

evaluate

public RuleEvalResult evaluate(String ruleName,
                               CharSequence selectedData,
                               org.milyn.container.ExecutionContext context)
                        throws org.milyn.SmooksException
Description copied from interface: RuleProvider
Evalutate the rule.

Specified by:
evaluate in interface RuleProvider
Parameters:
ruleName - The ruleName to be used in this evaluation.
selectedData - The data that this evalute method will evaluate upon.
context - The Smooks Excecution context.
Returns:
RuleEvalResult Object representing an evaluation result.
Throws:
org.milyn.SmooksException

getName

public String getName()
Description copied from interface: RuleProvider
Gets this providers name.

Specified by:
getName in interface RuleProvider
Returns:
String This providers name.

setName

public void setName(String name)
Description copied from interface: RuleProvider
The name of this rule provider.

Specified by:
setName in interface RuleProvider
Parameters:
name - The rule providers name.

getSrc

public String getSrc()
Description copied from interface: RuleProvider
Gets the source for this rule provider

Specified by:
getSrc in interface RuleProvider
Returns:
String The src for this rule provider

setSrc

public void setSrc(String src)
Description copied from interface: RuleProvider
Sets the src for this rule provider.

Specified by:
setSrc in interface RuleProvider
Parameters:
src - The source which defines the rules.

loadRules

protected void loadRules(String ruleFile)
Load the regex rule from the specified rule file.

Parameters:
ruleFile - The rule file path.


Copyright © 2018. All rights reserved.