Package net.sf.saxon.functions
Class RegexFunction
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.RegexFunction
- All Implemented Interfaces:
- Callable,- StatefulSystemFunction,- FunctionItem,- GroundedValue,- Item,- Sequence
- Direct Known Subclasses:
- AnalyzeStringFn,- Matches,- Replace,- ReplaceWith,- Tokenize_3
This class implements any of the functions matches(), replace(), tokenize(), analyze-string(), in the
 version where a flags argument is present in the argument list
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract booleancopy()Make a copy of this SystemFunction.protected RegularExpressiongetRegularExpression(Sequence[] args, int regexPos, int flagsPos) Get the regular expression at evaluation timemakeFunctionCall(Expression... arguments) Make an expression that either calls this function, or that is equivalent to a call on this functionmakeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments) Allow the function to create an optimized call based on the values of the actual argumentsMethods inherited from class net.sf.saxon.functions.SystemFunctiondependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCallerMethods inherited from class net.sf.saxon.functions.AbstractFunctionatomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheckMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.FunctionItemgetGenreMethods inherited from interface net.sf.saxon.om.GroundedValueasIterable, concatenate, containsNode, materializeMethods inherited from interface net.sf.saxon.om.ItemgetLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.SequencemakeRepeatable
- 
Constructor Details- 
RegexFunctionpublic RegexFunction()
 
- 
- 
Method Details- 
getStaticRegex
- 
copyMake 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:
- copyin interface- StatefulSystemFunction
- Returns:
- a copy of the system function able to contain its own copy of the state on behalf of the caller.
 
- 
allowRegexMatchingEmptyStringprotected abstract boolean allowRegexMatchingEmptyString()
- 
makeFunctionCallMake an expression that either calls this function, or that is equivalent to a call on this function- Overrides:
- makeFunctionCallin class- SystemFunction
- Parameters:
- arguments- the supplied arguments to the function call
- Returns:
- either a function call on this function, or an expression that delivers the same result
 
- 
makeOptimizedFunctionCallpublic 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- Overrides:
- makeOptimizedFunctionCallin class- SystemFunction
- Parameters:
- 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.
- Returns:
- either a function call on this function, or an expression that delivers the same result, or null indicating that no optimization has taken place
- Throws:
- XPathException- if an error is detected
 
- 
getRegularExpressionprotected RegularExpression getRegularExpression(Sequence[] args, int regexPos, int flagsPos) throws XPathException Get the regular expression at evaluation time- Parameters:
- args- the argument values in the function call
- Returns:
- 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.
- Throws:
- XPathException- if the regular expression is invalid
 
 
-