net.sf.saxon.query
public class GlobalVariableDefinition extends Object implements VariableDeclaration, Declaration
Field Summary | |
---|---|
protected List | references |
Method Summary | |
---|---|
GlobalVariable | compile(StaticQueryContext env, int slot)
Create a compiled representation of this global variable |
void | explain(NamePool pool)
Produce diagnostic output showing the compiled and optimized expression tree for a function |
int | getColumnNumber()
Get column number |
GlobalVariable | getCompiledVariable()
Get the compiled variable if the definition has been compiled |
int | getLineNumber()
Get the line number where the declaration appears |
int | getNameCode()
Get the variable name |
String | getPublicId()
Get public identifier |
SequenceType | getRequiredType()
Get the required type of the variable |
String | getSystemId()
Get the system ID of the module containing the variable declaration |
String | getVariableName()
Get the name of the variable |
Iterator | iterateReferences()
Iterate over the references to this variable |
void | registerReference(BindingReference ref)
Register a variable reference that refers to this global variable |
void | setIsParameter(boolean b)
Indicate whether this global variable is a "parameter" (an external variable, in XQuery terminology) |
void | setLineNumber(int lineNumber)
Set the line number where the variable declaration appears in the source |
void | setNameCode(int nameCode)
Set the variable name |
void | setRequiredType(SequenceType type)
Set the required type of the variable |
void | setSystemId(String systemId)
Set the system ID of the module where the variable declaration appears |
void | setValueExpression(Expression val)
Set the expression used to define the value of the variable |
void | setVariableName(String variableName)
Set the variable name |
static void | typeCheck(StaticQueryContext env, GeneralVariable var)
Type check the compiled representation of this global variable |
Parameters: env the static context for the query module slot the slot number allocated to this variable
Returns: the compiled representation
Throws: XPathException if compile-time errors are found.
Parameters: pool the namepool to be used
Returns: -1 always
Returns: the variable name, expressed as a NamePool name code
Returns: null always
Returns: the declared type, from the "as" clause if present
Returns: the variable name, as a lexical QName
Parameters: ref the variable reference
Parameters: b true if this variable is external
Parameters: lineNumber the line number
Parameters: nameCode the variable name, expressed as a NamePool name code
Parameters: type the declared type, from the "as" clause if present
Parameters: val the initializing expression
Parameters: variableName the variable name, as a lexical QName
Parameters: env the static context for the query module
Throws: XPathException if compile-time errors are found.