Package org.jaxen.function
Class ContainsFunction
- java.lang.Object
-
- org.jaxen.function.ContainsFunction
-
- All Implemented Interfaces:
Function
public class ContainsFunction extends java.lang.Object implements Function
4.2
boolean contains(string,string)
The contains function returns true if the first argument string contains the second argument string, and otherwise returns false.
- Author:
- bob mcwhirter (bob @ werken.com)
- See Also:
- Section 4.2 of the XPath Specification
-
-
Constructor Summary
Constructors Constructor Description ContainsFunction()
Create a newContainsFunction
object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
call(Context context, java.util.List args)
Returns true if the string-value of the first item inargs
contains string-value of the second item; false otherwise.static java.lang.Boolean
evaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)
Returns true if the first string contains the second string; false otherwise.
-
-
-
Method Detail
-
call
public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
Returns true if the string-value of the first item in
args
contains string-value of the second item; false otherwise. If necessary one or both items are converted to a string as if by the XPathstring()
function.- Specified by:
call
in interfaceFunction
- Parameters:
context
- the context at the point in the expression when the function is calledargs
- a list containing exactly two items- Returns:
- the result of evaluating the function;
Boolean.TRUE
orBoolean.FALSE
- Throws:
FunctionCallException
- ifargs
does not have exactly two items
-
evaluate
public static java.lang.Boolean evaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)
Returns true if the first string contains the second string; false otherwise. If necessary one or both arguments are converted to a string as if by the XPath
string()
function.- Parameters:
strArg
- the containing stringmatchArg
- the contained stringnav
- used to calculate the string-values of the first two arguments- Returns:
Boolean.TRUE
if true if the first string contains the second string;Boolean.FALSE
otherwise.
-
-