Package wt.rule.algorithm
Class StringRegExEqualsTest
java.lang.Object
wt.rule.algorithm.StringRegExEqualsTest
- All Implemented Interfaces:
RuleAlgorithm
Given an attribute and a value, with "*" in the value, determine the equality using Regular Expression related
concepts. The point here is to make available the java.util.regex implementation of regular expression matching. The
return would be true if it finds a match and the match is the whole string argument. Force arg[0] using toString()
first before comparison.
If the length of the arguments passed is not two, throw exception.Force arg[0] using toString() first before
comparison. If arg[1] passed is not String, throw exception. return Pattern.matches(arg[1], arg[0].toString()); OR:
Pattern p=Pattern.compile(arg[1]); Matcher m=p.matcher(arg[0].toString()); Return m.matches(); true if, and only if,
the entire input sequence matches this matcher's pattern
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptioncalculate(Object[] args, WTContainerRef container) Execute the algorithm using the specified arguments.
-
Method Details
-
calculate
Execute the algorithm using the specified arguments. Return the result.
Supported API: true- Specified by:
calculatein interfaceRuleAlgorithm- Parameters:
args- the arguments for the algorithmcontainer- the container to use for object lookups- Returns:
- Object
- Throws:
WTException
-