Package net.sf.saxon.functions
Class KeyFn
java.lang.Object
net.sf.saxon.functions.AbstractFunction
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.KeyFn
- All Implemented Interfaces:
Callable,IFunctionWithRetainedParameterNames,StatefulSystemFunction,FunctionItem,GroundedValue,Item,Sequence
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(XPathContext context, Sequence[] arguments) Evaluate the expressioncopy()Make a copy of this SystemFunction.fixArguments(Expression... arguments) Allow the function to create an optimized call based on the values of the actual arguments.intgetSpecialProperties(Expression[] arguments) Get the static properties of this expression (other than its type).static ExpressioninternalKeyCall(KeyManager keyManager, KeyDefinitionSet keySet, String name, Expression value, Expression doc, RetainedStaticContext rsc) Factory method to create an internal call on key() with a known key definitionprotected static Sequencesearch(KeyManager keyManager, XPathContext context, Sequence sought, NodeInfo origin, KeyDefinitionSet selectedKeySet) Methods inherited from class net.sf.saxon.functions.SystemFunction
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, getArity, getCardinality, getContextNode, getDescription, getDetails, getElaborator, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getNetCost, getOperandRoles, getParameterNames, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getStaticBaseUriString, getStreamerName, getUniqueIdentifier, getUniStringArg, hashCode, importAttributes, isSequenceVariadic, isTrustedResultType, makeCall, makeFunction, makeFunction40, makeFunctionCall, makeOptimizedFunctionCall, makeTrueFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCallerMethods inherited from class net.sf.saxon.functions.AbstractFunction
atomize, deepEqual40, deepEquals, effectiveBooleanValue, getAnnotations, getUnicodeStringValue, isArray, isMap, makeNewContext, simplify, typeCheckMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.sf.saxon.om.FunctionItem
getGenreMethods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materializeMethods inherited from interface net.sf.saxon.om.Item
getLabel, getLength, getStringValue, head, isStreamed, itemAt, iterate, reduce, subsequenceMethods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
Constructor Details
-
KeyFn
public KeyFn()
-
-
Method Details
-
getKeyManager
-
getNamespaceResolver
-
internalKeyCall
public static Expression internalKeyCall(KeyManager keyManager, KeyDefinitionSet keySet, String name, Expression value, Expression doc, RetainedStaticContext rsc) Factory method to create an internal call on key() with a known key definition- Parameters:
keySet- the set of KeyDefinitions (always a single KeyDefinition)name- the name allocated to the key (first argument of the function)value- the value being searched for (second argument of the function)doc- the document being searched (third argument)- Returns:
- a call on the key() function
-
getSpecialProperties
Get the static properties of this expression (other than its type). The result is bit-signficant. These properties are used for optimizations. In general, if a property bit is set, it is true, but if it is unset, the value is unknown.- Overrides:
getSpecialPropertiesin classSystemFunction- Parameters:
arguments- expressions supplied as arguments in the function call- Returns:
- the properties
-
copy
Description copied from interface:StatefulSystemFunctionMake 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 interfaceStatefulSystemFunction- Returns:
- a copy of the system function able to contain its own copy of the state on behalf of the caller.
-
fixArguments
Allow the function to create an optimized call based on the values of the actual arguments. This binds the key definition in the common case where the key name is defined statically- Overrides:
fixArgumentsin classSystemFunction- Parameters:
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
-
call
Evaluate the expression- Specified by:
callin interfaceCallable- Parameters:
context- the dynamic evaluation contextarguments- the values of the arguments, supplied as Sequences- Returns:
- the result of the evaluation, in the form of a Sequence
- Throws:
XPathException- if a dynamic error occurs during the evaluation of the expression
-
search
protected static Sequence search(KeyManager keyManager, XPathContext context, Sequence sought, NodeInfo origin, KeyDefinitionSet selectedKeySet) throws XPathException - Throws:
XPathException
-