Package org.jaxen.function
Class StartsWithFunction
- java.lang.Object
-
- org.jaxen.function.StartsWithFunction
-
- All Implemented Interfaces:
Function
public class StartsWithFunction extends java.lang.Object implements Function
4.2
boolean starts-with(string,string)The starts-with function returns true if the first argument string starts with 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 StartsWithFunction()Create a newStartsWithFunctionobject.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectcall(Context context, java.util.List args)Returns true if the string-value of the first item inargsstarts with the string-value of the second item inargs.static java.lang.Booleanevaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)Returns true if the string-value ofstrArgstarts with the string-value ofmatchArg.
-
-
-
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 inargsstarts with the string-value of the second item inargs. Otherwise it returns false.- Specified by:
callin interfaceFunction- Parameters:
context- the context at the point in the expression when the function is calledargs- a list that contains two items- Returns:
Boolean.TRUEif the first item inargsstarts with the string-value of the second item inargs; otherwiseBoolean.FALSE- Throws:
FunctionCallException- ifargsdoes not have length two
-
evaluate
public static java.lang.Boolean evaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)Returns true if the string-value ofstrArgstarts with the string-value ofmatchArg. Otherwise it returns false.- Parameters:
strArg- the object whose string-value searched for the prefixmatchArg- the object whose string-value becomes the prefix string to compare againstnav- the navigator used to calculate the string-values of the arguments- Returns:
Boolean.TRUEif the string-value ofstrArgstarts with the string-value ofmatchArg; otherwiseBoolean.FALSE
-
-