Class LikeFunction
java.lang.Object
com.randomnoun.common.jexl.eval.function.LikeFunction
- All Implemented Interfaces:
EvalFunction
- Direct Known Subclasses:
LikeFunction
Defines a like() function.
like() takes a two parameters, the string being matched and the SQL LIKE pattern we are matching on. The LIKE pattern uses the "%" character to represent any sequence of characters, and "_" to indicate a single character. This class automatically deals with conflicts with the Java regex parser, so the pattern may contain any other Unicode or regular expression characters, which will be treated like any other character.
The result of the function is of type Boolean.
-
Field Summary
Fields inherited from interface com.randomnoun.common.jexl.eval.EvalFunction
logger
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LikeFunction
public LikeFunction()
-
-
Method Details
-
evaluate
public Object evaluate(String functionName, EvalContext context, List<Object> arguments) throws EvalException Implements the function as per the class description.- Specified by:
evaluate
in interfaceEvalFunction
- Parameters:
functionName
- The name of the function to be evaluated (can be disregarded if this class only performs a single function)context
- The context in which the function is being executed (could hold things like local variable values, current line number, etc...)arguments
- The arguments passed to this function- Returns:
- The result of the evaluation
- Throws:
EvalException
- An exception occurred during evaluation
-