net.sf.saxon.instruct

Class UserFunctionParameter

public class UserFunctionParameter extends Object implements Binding, Serializable

Run-time object representing a formal argument to a user-defined function
Constructor Summary
UserFunctionParameter()
Create a UserFunctionParameter
Method Summary
ValueRepresentationevaluateVariable(XPathContext context)
Evaluate this function parameter
intgetLocalSlotNumber()
If this is a local variable held on the local stack frame, return the corresponding slot number.
intgetReferenceCount()
Get the (nominal) number of references within the function body to this parameter, where a reference inside a loop is counted as multiple references
SequenceTypegetRequiredType()
Get the required type of this function parameter
StructuredQNamegetVariableQName()
Get the name of this parameter
booleanisAssignable()
Test whether it is permitted to assign to the variable using the saxon:assign extension element.
booleanisGlobal()
Indicate whether the binding is local or global.
booleanisIndexedVariable()
Ask whether this parameter requires support for indexing
voidsetIndexedVariable(boolean indexed)
Indicate that this parameter requires (or does not require) support for indexing
voidsetReferenceCount(int count)
Set the (nominal) number of references within the function body to this parameter, where a reference inside a loop is counted as multiple references
voidsetRequiredType(SequenceType type)
Set the required type of this function parameter
voidsetSlotNumber(int slot)
Set the slot number to be used by this parameter
voidsetVariableQName(StructuredQName name)
Set the name of this parameter

Constructor Detail

UserFunctionParameter

public UserFunctionParameter()
Create a UserFunctionParameter

Method Detail

evaluateVariable

public ValueRepresentation evaluateVariable(XPathContext context)
Evaluate this function parameter

Parameters: context the XPath dynamic context

Returns: the value of the parameter

Throws: XPathException if an error occurs

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.

Returns: the slot number, indicating the position of the parameter on the local stack frame

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

Returns: the nominal number of references

getRequiredType

public SequenceType getRequiredType()
Get the required type of this function parameter

Returns: the declared type of the parameter

getVariableQName

public StructuredQName getVariableQName()
Get the name of this parameter

Returns: the name of this parameter

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.

Returns: false (always)

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.

Returns: false (always)

isIndexedVariable

public boolean isIndexedVariable()
Ask whether this parameter requires support for indexing

Returns: 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(boolean indexed)
Indicate that this parameter requires (or does not require) support for indexing

Parameters: 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]

setReferenceCount

public void setReferenceCount(int count)
Set the (nominal) number of references within the function body to this parameter, where a reference inside a loop is counted as multiple references

Parameters: count the nominal number of references

setRequiredType

public void setRequiredType(SequenceType type)
Set the required type of this function parameter

Parameters: type the declared type of the parameter

setSlotNumber

public void setSlotNumber(int slot)
Set the slot number to be used by this parameter

Parameters: slot the slot number, that is, the position of the parameter value within the local stack frame

setVariableQName

public void setVariableQName(StructuredQName name)
Set the name of this parameter

Parameters: name the name of the parameter