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
,Function
,GroundedValue
,Item
,Sequence
public class CollatingFunctionFree extends SystemFunction
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 ofCollatingFunctionFixed
, or failing that, the collation argument is evaluated at run-time.
-
-
Constructor Summary
Constructors Constructor Description CollatingFunctionFree()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CollatingFunctionFixed
bindCollation(java.lang.String collationName)
Create an instance of (a subclass of) CollatingFunctionFixed representing the underlying function but with the collator already boundSequence
call(XPathContext context, Sequence[] args)
Invoke the function.static java.lang.String
expandCollationURI(java.lang.String collationName, java.net.URI expressionBaseURI)
Expand a collation URI, which may be a relative URI referencejava.lang.String
getStreamerName()
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.Expression
makeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments)
Allow the function to create an optimized call based on the values of the actual arguments-
Methods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
-
Methods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getSerialNumber, 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.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
-
-
-
-
Method Detail
-
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
public CollatingFunctionFixed bindCollation(java.lang.String collationName) throws XPathException
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 java.lang.String expandCollationURI(java.lang.String collationName, java.net.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
public Sequence call(XPathContext context, Sequence[] args) throws XPathException
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
public java.lang.String 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.
-
-