Package net.sf.saxon.functions
Class CollatingFunctionFree
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.CollatingFunctionFree
- All Implemented Interfaces:
Callable
,FunctionItem
,GroundedValue
,Item
,Sequence
Generic class for all functions that take an optional collation argument,
where the collation argument is supplied and has not yet been resolved. The
class provides methods that either do early evaluation of the collation
argument (converting the function to the corresponding instance of
CollatingFunctionFixed
, or failing that,
the collation argument is evaluated at run-time.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbindCollation
(String collationName) Create an instance of (a subclass of) CollatingFunctionFixed representing the underlying function but with the collator already boundcall
(XPathContext context, Sequence[] args) Invoke the function.static String
expandCollationURI
(String collationName, URI expressionBaseURI) Expand a collation URI, which may be a relative URI referenceprotected int
Get the argument position (0-based) containing the collation nameGet a name that identifies the class that can be used to evaluate this function in streaming mode, that is, supplying one item or event at a time as it is delivered by the parser.makeOptimizedFunctionCall
(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.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheck
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.saxon.om.FunctionItem
getGenre
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
Methods inherited from interface net.sf.saxon.om.Item
getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequence
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
CollatingFunctionFree
public CollatingFunctionFree()
-
-
Method Details
-
getCollationArgument
protected int getCollationArgument()Get the argument position (0-based) containing the collation name- Returns:
- the position of the argument containing the collation URI
-
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- Overrides:
makeOptimizedFunctionCall
in classSystemFunction
- Parameters:
visitor
- the expression visitorcontextInfo
- information about the context itemarguments
- the supplied arguments to the function call- 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
-
bindCollation
Create an instance of (a subclass of) CollatingFunctionFixed representing the underlying function but with the collator already bound- Parameters:
collationName
- the name of the collation to be used- Returns:
- a function to implement this function with a fixed collation
- Throws:
XPathException
- if the collation is unknown
-
expandCollationURI
public static String expandCollationURI(String collationName, URI expressionBaseURI) throws XPathException Expand a collation URI, which may be a relative URI reference- Parameters:
collationName
- the collation URI as providedexpressionBaseURI
- the base URI against which the collation URI will be resolved if it is relative- Returns:
- the resolved (expanded) absolute collation URI
- Throws:
XPathException
- if the collation URI cannot be resolved
-
call
Invoke the function. This is done in effect by currying the function: that is, creating a new function in which the collation argument is bound, and then invoking that new function.- Parameters:
context
- the XPath dynamic evaluation contextargs
- the actual arguments to be supplied- Returns:
- the result of invoking the function
- Throws:
XPathException
- if a dynamic error occurs within the function
-
getStreamerName
Description copied from class:SystemFunction
Get a name that identifies the class that can be used to evaluate this function in streaming mode, that is, supplying one item or event at a time as it is delivered by the parser. Special streaming support is generally available in Saxon-EE for all system functions that take a sequence as their argument.- Overrides:
getStreamerName
in classSystemFunction
- Returns:
- a name that identifies a class that supports streamed evaluation of this system
function, or null if no such class is available. The mapping of names to classes is
defined in the Saxon-EE class
StreamerMap
. In non-streaming Saxon editions (HE and PE) the method always returns null.
-