net.sf.saxon.xpath

Class XPathFunctionCall

public class XPathFunctionCall extends FunctionCall

This class is an expression that calls an external function supplied using the JAXP XPathFunction interface
Constructor Summary
XPathFunctionCall(XPathFunction function)
Default constructor
Method Summary
SequenceIteratorcall(ValueRepresentation[] argValues, XPathContext context)
Call an extension function previously identified using the bind() method.
voidcheckArguments(StaticContext env)
Method called by the expression parser when all arguments have been supplied
intcomputeCardinality()
Determine the cardinality of the result
intgetIntrinsicDependencies()
Determine which aspects of the context the expression depends on.
ItemTypegetItemType(TypeHierarchy th)
Determine the data type of the expression, if possible.
SequenceIteratoriterate(XPathContext context)
Evaluate the function.
ExpressionpreEvaluate(StaticContext env)
preEvaluate: this method suppresses compile-time evaluation by doing nothing (because the external function might have side-effects and might use the context)

Constructor Detail

XPathFunctionCall

public XPathFunctionCall(XPathFunction function)
Default constructor

Method Detail

call

public SequenceIterator call(ValueRepresentation[] argValues, XPathContext context)
Call an extension function previously identified using the bind() method. A subclass can override this method.

Parameters: argValues The values of the arguments

Returns: The value returned by the extension function

checkArguments

public void checkArguments(StaticContext env)
Method called by the expression parser when all arguments have been supplied

computeCardinality

public int computeCardinality()
Determine the cardinality of the result

Returns: ZERO_OR_MORE (we don't know)

getIntrinsicDependencies

public int getIntrinsicDependencies()
Determine which aspects of the context the expression depends on. XPath external functions are given no access to context information so they cannot have any dependencies on it.

getItemType

public ItemType getItemType(TypeHierarchy th)
Determine the data type of the expression, if possible. All expressions return sequences, in general; this method determines the type of the items within the sequence, assuming that (a) this is known in advance, and (b) it is the same for all items in the sequence.

This method will always return a result, though it may be the best approximation that is available at the time.

Parameters: th

Returns: the item type

iterate

public SequenceIterator iterate(XPathContext context)
Evaluate the function.

Parameters: context The context in which the function is to be evaluated

Returns: a Value representing the result of the function.

Throws: XPathException if the function cannot be evaluated.

preEvaluate

public Expression preEvaluate(StaticContext env)
preEvaluate: this method suppresses compile-time evaluation by doing nothing (because the external function might have side-effects and might use the context)