Class ContextAccessorFunction

All Implemented Interfaces:
Callable, IContextAccessorFunction, IFunctionWithRetainedParameterNames, FunctionItem, GroundedValue, Item, Sequence
Direct Known Subclasses:
ContextItemAccessorFunction, CurrentGroup, CurrentGroupingKey, CurrentOutputUri, FunctionLookup, PositionAndLast, RegexGroup

public abstract class ContextAccessorFunction extends SystemFunction implements IContextAccessorFunction
A ContextAccessorFunction is a function that is dependent on the dynamic context. In the case of dynamic function calls, the context is bound at the point where the function is created, not at the point where the function is called.
  • Constructor Details

    • ContextAccessorFunction

      public ContextAccessorFunction()
  • Method Details

    • dependsOnContext

      public boolean dependsOnContext()
      Description copied from interface: IContextAccessorFunction
      Ask whether this function is actually dependent on the dynamic context
      Specified by:
      dependsOnContext in interface IContextAccessorFunction
      Returns:
      true if the function cannot be used unless the dynamic context is first bound
    • call

      public Sequence call(XPathContext context, Sequence[] arguments) throws XPathException
      Evaluate the expression
      Specified by:
      call in interface Callable
      Parameters:
      context - the dynamic evaluation context
      arguments - 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