Class RegexFunction

    • Constructor Detail

      • RegexFunction

        public RegexFunction()
    • Method Detail

      • copy

        public RegexFunction copy()
        Make a copy of this SystemFunction. This is required only for system functions such as regex functions that maintain state on behalf of a particular caller.
        Specified by:
        copy in interface StatefulSystemFunction
        a copy of the system function able to contain its own copy of the state on behalf of the caller.
      • allowRegexMatchingEmptyString

        protected abstract boolean allowRegexMatchingEmptyString()
      • makeFunctionCall

        public Expression makeFunctionCall​(Expression... arguments)
        Make an expression that either calls this function, or that is equivalent to a call on this function
        makeFunctionCall in class SystemFunction
        arguments - the supplied arguments to the function call
        either a function call on this function, or an expression that delivers the same result
      • makeOptimizedFunctionCall

        public Expression makeOptimizedFunctionCall​(ExpressionVisitor visitor,
                                                    ContextItemStaticInfo contextInfo,
                                                    Expression... arguments)
                                             throws XPathException
        Allow the function to create an optimized call based on the values of the actual arguments
        makeOptimizedFunctionCall in class SystemFunction
        visitor - the expression visitor
        contextInfo - information about the context item
        arguments - the supplied arguments to the function call. Note: modifying the contents of this array should not be attempted, it is likely to have no effect.
        either a function call on this function, or an expression that delivers the same result, or null indicating that no optimization has taken place
        XPathException - if an error is detected
      • getRegularExpression

        protected RegularExpression getRegularExpression​(Sequence[] args,
                                                         int regexPos,
                                                         int flagsPos)
                                                  throws XPathException
        Get the regular expression at evaluation time
        args - the argument values in the function call
        the compiled regular expression; either the expression pre-compiled statically, or the result of compiling it dynamically. The XPath 4.0 tokenize() function allows the argument to be an empty sequence; in this case return null.
        XPathException - if the regular expression is invalid