Class AbstractFunction

    • Constructor Detail

      • AbstractFunction

        public AbstractFunction()
    • Method Detail

      • getOperandRoles

        public OperandRole[] getOperandRoles()
        Get the roles of the arguments, for the purposes of streaming
        Specified by:
        getOperandRoles in interface FunctionItem
        Returns:
        an array of OperandRole objects, one for each argument
      • isArray

        public boolean isArray()
        Ask whether this function is an array
        Specified by:
        isArray in interface FunctionItem
        Returns:
        true if this function item is an array, otherwise false
      • isMap

        public boolean isMap()
        Ask whether this function is a map
        Specified by:
        isMap in interface FunctionItem
        Returns:
        true if this function item is a map, otherwise false
      • getAnnotations

        public AnnotationList getAnnotations()
        Description copied from interface: FunctionItem
        Get the function annotations (as defined in XQuery). Returns an empty list if there are no function annotations.
        Specified by:
        getAnnotations in interface FunctionItem
        Returns:
        the function annotations
      • typeCheck

        public void typeCheck​(ExpressionVisitor visitor,
                              ContextItemStaticInfo contextItemType)
                       throws XPathException
        Type check the function (may modify it by adding code for converting the arguments)
        Parameters:
        visitor - the expression visitor, supplies context information
        contextItemType - the context item type at the point where the function definition appears
        Throws:
        XPathException - if any failure (e.g. a type checking failure) occurs
      • makeNewContext

        public XPathContext makeNewContext​(XPathContext callingContext,
                                           ContextOriginator originator)
        Prepare an XPathContext object for evaluating the function
        Specified by:
        makeNewContext in interface FunctionItem
        Parameters:
        callingContext - the XPathContext of the function calling expression
        originator - the originator of the new context
        Returns:
        a suitable context for evaluating the function (which may or may not be the same as the caller's context)
      • deepEquals

        public boolean deepEquals​(FunctionItem other,
                                  XPathContext context,
                                  AtomicComparer comparer,
                                  int flags)
                           throws XPathException
        Test whether this FunctionItem is deep-equal to another function item, under the rules of the deep-equal function
        Specified by:
        deepEquals in interface FunctionItem
        Parameters:
        other - the other function item
        context - the dynamic evaluation context
        comparer - the object to perform the comparison
        flags - options for how the comparison is performed
        Returns:
        true if the two function items are deep-equal
        Throws:
        XPathException - if the comparison cannot be performed
      • isTrustedResultType

        public boolean isTrustedResultType()
        Check that result type is SystemFunction or AtomicConstructorFunction
        Specified by:
        isTrustedResultType in interface FunctionItem
        Returns:
        true if the implementation can be trusted
      • toShortString

        public java.lang.String toShortString()
        Description copied from interface: FunctionItem
        Provide a short string showing the contents of the item, suitable for use in error messages
        Specified by:
        toShortString in interface FunctionItem
        Specified by:
        toShortString in interface GroundedValue
        Specified by:
        toShortString in interface Item
        Returns:
        a depiction of the item suitable for use in error messages