## net.sf.saxon.query
Class GlobalVariableDefinition

    java.lang.Object
      |
      +--net.sf.saxon.query.GlobalVariableDefinition

All Implemented Interfaces:
  VariableDeclaration

public class GlobalVariableDefinition
extends java.lang.Object
implements VariableDeclaration

Class to hold compile-time information about an XQuery global variable or parameter

Constructor Summary
`GlobalVariableDefinition()`

Method Summary
`GeneralVariable` `compile(StaticQueryContext env, int slot)`
`void` `explain(NamePool pool)` Produce diagnostic output showing the compiled and optimized expression tree for a function
`int` `getNameCode()` Get the fingerprint code that identifies the name of the variable
`java.lang.String` `getVariableName()` Get the name of the variable for use in diagnostics - a lexical QName
`void` `registerReference(BindingReference ref)` Method called by a BindingReference to register the variable reference for subsequent fixup.
`void` `setIsParameter(boolean b)`
`void` `setLineNumber(int lineNumber)`
`void` `setNameCode(int nameCode)`
`void` `setRequiredType(SequenceType type)`
`void` `setValueExpression(Expression val)`
`void` `setVariableName(java.lang.String variableName)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### GlobalVariableDefinition

    public GlobalVariableDefinition()

Method Detail

### setRequiredType

    public void setRequiredType(SequenceType type)

### setNameCode

    public void setNameCode(int nameCode)

### setLineNumber

    public void setLineNumber(int lineNumber)

### getVariableName

    public java.lang.String getVariableName()

  Description copied from interface: `VariableDeclaration`
  Get the name of the variable for use in diagnostics - a lexical QName

  Specified by:
    `getVariableName` in interface `VariableDeclaration`

### setVariableName

    public void setVariableName(java.lang.String variableName)

### setValueExpression

    public void setValueExpression(Expression val)

### setIsParameter

    public void setIsParameter(boolean b)

### registerReference

    public void registerReference(BindingReference ref)

  Description copied from interface: `VariableDeclaration`
  Method called by a BindingReference to register the variable reference for subsequent fixup. This method is called by the XPath parser when each reference to the variable is encountered. At some time after parsing and before execution of the expression, the VariableDeclaration is responsible for calling the two methods setStaticType() and fixup() on each BindingReference that has been registered with it.

  Specified by:
    `registerReference` in interface `VariableDeclaration`

### getNameCode

    public int getNameCode()

  Description copied from interface: `VariableDeclaration`
  Get the fingerprint code that identifies the name of the variable

  Specified by:
    `getNameCode` in interface `VariableDeclaration`

### compile

    public GeneralVariable compile(StaticQueryContext env,
                                   int slot)
                            throws XPathException

    `XPathException`

### explain

    public void explain(NamePool pool)

  Produce diagnostic output showing the compiled and optimized expression tree for a function

  Parameters:
    `pool` - the namepool to be used