public class KeyFn extends SystemFunction implements StatefulSystemFunction
Modifier and Type | Class and Description |
---|---|
static class |
KeyFn.SubtreeFilter
Mapping class to filter nodes that have the origin node as an ancestor-or-self
|
Constructor and Description |
---|
KeyFn() |
Modifier and Type | Method and Description |
---|---|
PathMap.PathMapNodeSet |
addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap.
|
Sequence<?> |
call(XPathContext context,
Sequence[] arguments)
Evaluate the expression
|
SystemFunction |
copy()
Make a copy of this SystemFunction.
|
Expression |
fixArguments(Expression... arguments)
Allow the function to create an optimized call based on the values of the actual arguments.
|
KeyManager |
getKeyManager() |
NamespaceResolver |
getNamespaceResolver() |
int |
getSpecialProperties(Expression[] arguments)
Get the static properties of this expression (other than its type).
|
static Expression |
internalKeyCall(KeyManager keyManager,
KeyDefinitionSet keySet,
java.lang.String name,
Expression value,
Expression doc,
RetainedStaticContext rsc)
Factory method to create an internal call on key() with a known key definition
|
protected static Sequence<NodeInfo> |
search(KeyManager keyManager,
XPathContext context,
Sequence<? extends AtomicValue> sought,
NodeInfo origin,
KeyDefinitionSet selectedKeySet) |
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
argumentArray, getGenre
getLength, head, isStreamed, itemAt, iterate, iterator, reduce, subsequence, toGroundedValue
asIterable, materialize
makeRepeatable
public KeyManager getKeyManager()
public NamespaceResolver getNamespaceResolver()
public static Expression internalKeyCall(KeyManager keyManager, KeyDefinitionSet keySet, java.lang.String name, Expression value, Expression doc, RetainedStaticContext rsc)
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)public int getSpecialProperties(Expression[] arguments)
getSpecialProperties
in class SystemFunction
arguments
- expressions supplied as arguments in the function callpublic SystemFunction copy()
StatefulSystemFunction
copy
in interface StatefulSystemFunction
public Expression fixArguments(Expression... arguments) throws XPathException
fixArguments
in class SystemFunction
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.XPathException
- if an error is detectedpublic PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
The default implementation of this method assumes that an expression does no navigation other than the navigation done by evaluating its subexpressions, and that the subexpressions are evaluated in the same context as the containing expression. The method must be overridden for any expression where these assumptions do not hold. For example, implementations exist for AxisExpression, ParentExpression, and RootExpression (because they perform navigation), and for the doc(), document(), and collection() functions because they create a new navigation root. Implementations also exist for PathExpression and FilterExpression because they have subexpressions that are evaluated in a different context from the calling expression.
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
- the PathMapNodeSet to which the paths embodied in this expression should be addedpublic Sequence<?> call(XPathContext context, Sequence[] arguments) throws XPathException
call
in interface Callable
call
in interface Function
context
- the dynamic evaluation contextarguments
- the values of the arguments, supplied as SequencesXPathException
- if a dynamic error occurs during the evaluation of the expressionprotected static Sequence<NodeInfo> search(KeyManager keyManager, XPathContext context, Sequence<? extends AtomicValue> sought, NodeInfo origin, KeyDefinitionSet selectedKeySet) throws XPathException
XPathException
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.