Class UserFunctionParameter

  • All Implemented Interfaces:
    Binding, LocalBinding

    public class UserFunctionParameter
    extends java.lang.Object
    implements LocalBinding
    Run-time object representing a formal argument to a user-defined function
    • Constructor Detail

      • UserFunctionParameter

        public UserFunctionParameter()
        Create a UserFunctionParameter
    • Method Detail

      • isGlobal

        public final boolean isGlobal()
        Indicate whether the binding is local or global. A global binding is one that has a fixed value for the life of a query or transformation; any other binding is local.
        Specified by:
        isGlobal in interface Binding
        false (always)
      • isAssignable

        public final boolean isAssignable()
        Test whether it is permitted to assign to the variable using the saxon:assign extension element. This will only be for an XSLT global variable where the extra attribute saxon:assignable="yes" is present.
        Specified by:
        isAssignable in interface Binding
        false (always)
      • setSlotNumber

        public void setSlotNumber​(int slot)
        Set the slot number to be used by this parameter
        slot - the slot number, that is, the position of the parameter value within the local stack frame
      • getLocalSlotNumber

        public int getLocalSlotNumber()
        If this is a local variable held on the local stack frame, return the corresponding slot number. In other cases, return -1.
        Specified by:
        getLocalSlotNumber in interface LocalBinding
        the slot number, indicating the position of the parameter on the local stack frame
      • setRequiredType

        public void setRequiredType​(SequenceType type)
        Set the required type of this function parameter
        type - the declared type of the parameter
      • getRequiredType

        public SequenceType getRequiredType()
        Get the required type of this function parameter
        Specified by:
        getRequiredType in interface Binding
        the declared type of the parameter
      • getIntegerBoundsForVariable

        public IntegerValue[] getIntegerBoundsForVariable()
        If the variable is bound to an integer, get the minimum and maximum possible values. Return null if unknown or not applicable
        Specified by:
        getIntegerBoundsForVariable in interface Binding
        a pair of integers containing the minimum and maximum values for the integer value; or null if the value is not an integer or the range is unknown
      • setVariableQName

        public void setVariableQName​(StructuredQName name)
        Set the name of this parameter
        name - the name of the parameter
      • addReference

        public void addReference​(VariableReference ref,
                                 boolean isLoopingReference)
        Description copied from interface: Binding
        Register a variable reference that refers to the variable bound in this expression
        Specified by:
        addReference in interface Binding
        ref - the variable reference
        isLoopingReference - - true if the reference occurs within a loop, such as the predicate of a filter expression
      • getReferenceCount

        public int getReferenceCount()
        Get the (nominal) number of references within the function body to this parameter, where a reference inside a loop is counted as multiple references
        the nominal number of references
      • setIndexedVariable

        public void setIndexedVariable​(boolean indexed)
        Indicate that this parameter requires (or does not require) support for indexing
        indexed - true if support for indexing is required. This will be set if the parameter is used in a filter expression such as $param[@a = 17]
      • setIndexedVariable

        public void setIndexedVariable()
        Description copied from interface: LocalBinding
        Say that the bound value has the potential to be indexed
        Specified by:
        setIndexedVariable in interface LocalBinding
      • isIndexedVariable

        public boolean isIndexedVariable()
        Ask whether this parameter requires support for indexing
        Specified by:
        isIndexedVariable in interface LocalBinding
        true if support for indexing is required. This will be set if the parameter is used in a filter expression such as $param[@a = 17]
      • evaluateVariable

        public Sequence evaluateVariable​(XPathContext context)
        Evaluate this function parameter
        Specified by:
        evaluateVariable in interface Binding
        context - the XPath dynamic context
        the value of the parameter
      • setFunctionStreamability

        public void setFunctionStreamability​(FunctionStreamability ability)
        If this is the first argument of a streamable stylesheet function, set the streamability category
        ability - the streamability category