Package org.jaxen.function
Class SubstringAfterFunction
- java.lang.Object
-
- org.jaxen.function.SubstringAfterFunction
-
- All Implemented Interfaces:
Function
public class SubstringAfterFunction extends java.lang.Object implements Function
4.2
string substring-after(string,string)
The substring-after function returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-after("1999/04/01","/") returns 04/01, and substring-after("1999/04/01","19") returns 99/04/01.
- See Also:
- Section 4.2 of the XPath Specification
-
-
Constructor Summary
Constructors Constructor Description SubstringAfterFunction()
Create a newSubstringAfterFunction
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 the part of the string-value of the first item inargs
that follows the string-value of the second item inargs
; or the empty string if the second string is not a substring of the first string.static java.lang.String
evaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)
Returns the part ofstrArg
that follows the first occurence ofmatchArg
; or the empty string if thestrArg
does not containmatchArg
-
-
-
Method Detail
-
call
public java.lang.Object call(Context context, java.util.List args) throws FunctionCallException
Returns the part of the string-value of the first item inargs
that follows the string-value of the second item inargs
; or the empty string if the second string is not a substring of the first string.- Specified by:
call
in interfaceFunction
- Parameters:
context
- the context at the point in the expression when the function is calledargs
- a list that contains two items- Returns:
- a
String
containing that part of the string-value of the first item inargs
that comes before the string-value of the second item inargs
- Throws:
FunctionCallException
- ifargs
does not have length two
-
evaluate
public static java.lang.String evaluate(java.lang.Object strArg, java.lang.Object matchArg, Navigator nav)
Returns the part ofstrArg
that follows the first occurence ofmatchArg
; or the empty string if thestrArg
does not containmatchArg
- Parameters:
strArg
- the string from which the substring is extractedmatchArg
- the string that marks the boundary of the substringnav
- theNavigator
used to calculate the string-values of the first two arguments- Returns:
- a
String
containing the part ofstrArg
that precedes the first occurence ofmatchArg
-
-