Class JavaExtensionLibrary.UnresolvedExtensionFunctionCall

  • All Implemented Interfaces:
    Callable, ExportAgent, Locatable, IdentityComparable, Traceable
    Enclosing class:
    JavaExtensionLibrary

    public class JavaExtensionLibrary.UnresolvedExtensionFunctionCall
    extends FunctionCall
    implements Callable
    Inner class representing an unresolved extension function call. This arises when there is insufficient static type information available at the time the function call is parsed to determine which of several candidate Java methods to invoke. The function call cannot be executed; it must be resolved to an actual Java method during the analysis phase.
    • Constructor Detail

      • UnresolvedExtensionFunctionCall

        public UnresolvedExtensionFunctionCall​(StructuredQName functionName,
                                               java.lang.Class theClass,
                                               java.util.List<java.lang.reflect.AccessibleObject> candidateMethods,
                                               Expression[] staticArgs,
                                               Configuration config,
                                               boolean debug)
    • Method Detail

      • typeCheck

        public Expression typeCheck​(ExpressionVisitor visitor,
                                    ContextItemStaticInfo contextInfo)
                             throws XPathException
        Type-check the expression.
        Overrides:
        typeCheck in class FunctionCall
        Parameters:
        visitor - an expression visitor
        contextInfo - Information available statically about the context item: whether it is (possibly) absent; its static type; its streaming posture.
        Returns:
        the original expression, rewritten to perform necessary run-time type checks, and to perform other type-related optimizations
        Throws:
        XPathException - if an error is discovered during this phase (typically a type error)
      • 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
      • getTargetFunction

        public Function getTargetFunction​(XPathContext context)
        Get the target function to be called
        Specified by:
        getTargetFunction in class FunctionCall
        Parameters:
        context - the dynamic evaluation context
        Returns:
        the target function
      • getItemType

        public ItemType getItemType()
        Determine the data type of the expression, if possible. All expression 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 should always return a result, though it may be the best approximation that is available at the time.

        Specified by:
        getItemType in class Expression
        Returns:
        a value such as Type.STRING, Type.BOOLEAN, Type.NUMBER, Type.NODE, or Type.ITEM (meaning not known at compile time)
      • copy

        public Expression copy​(RebindingMap rebindings)
        Copy an expression. This makes a deep copy.
        Specified by:
        copy in class Expression
        Parameters:
        rebindings - variables to be re-bound
        Returns:
        the copy of the original expression