org.deri.iris.builtins.string
Class StringReplaceBuiltin
java.lang.Object
org.deri.iris.builtins.AbstractBuiltin
org.deri.iris.builtins.FunctionalBuiltin
org.deri.iris.builtins.string.StringReplaceBuiltin
- All Implemented Interfaces:
- Comparable<IAtom>, IAtom, IBuiltinAtom
public class StringReplaceBuiltin
- extends FunctionalBuiltin
Represents the RIF built-in func:replace as described in
http://www.w3.org/TR/xpath-functions/#func-replace.
|
Method Summary |
protected ITerm |
computeResult(ITerm[] terms)
Computes the result when all terms but the term at the last position are
known. |
StringReplaceBuiltin
public StringReplaceBuiltin(ITerm... terms)
- Constructor.
- Parameters:
term - The terms, where the term at the first position is the
string, the term at the second position is the regex, the term
at the third position is the replacement and the term at the
fourth position are the flags and the term at the fifth
position represents the result. The string is the string to
apply the replace operation on. The regex is the regular
expression. The replacement is the replacement for the
matching substrings. The flags are the flags as described in
http://www.w3.org/TR/xpath-functions/#flags.
- Throws:
IllegalArgumentException - if one of the terms is null
computeResult
protected ITerm computeResult(ITerm[] terms)
throws EvaluationException
- Description copied from class:
FunctionalBuiltin
- Computes the result when all terms but the term at the last position are
known.
- Specified by:
computeResult in class FunctionalBuiltin
- Parameters:
terms - The terms, where the terms at the last position is a
variable representing the result.
- Returns:
- The computed term, or
null if the operation is
unsuccessful.
- Throws:
EvaluationException - If an error occurs.