javax.xml.transform.SourceLocator
, VariableDeclaration
, Declaration
UndeclaredVariable
public class GlobalVariableDefinition extends java.lang.Object implements VariableDeclaration, Declaration
Modifier and Type | Field | Description |
---|---|---|
protected java.util.List |
references |
Constructor | Description |
---|---|
GlobalVariableDefinition() |
Modifier and Type | Method | Description |
---|---|---|
GlobalVariable |
compile(Executable exec,
int slot) |
Create a compiled representation of this global variable
|
void |
explain(ExpressionPresenter out) |
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
|
java.lang.String |
getPublicId() |
Get public identifier
|
SequenceType |
getRequiredType() |
Get the required type of the variable
|
java.lang.String |
getSystemId() |
Get the system ID of the module containing the variable declaration
|
Expression |
getValueExpression() |
Get the expression used to initialize the value of the variable
|
StructuredQName |
getVariableQName() |
Get the variable name
|
boolean |
isParameter() |
Ask whether this global variable is a "parameter" (an external variable, in XQuery terminology)
|
boolean |
isPrivate() |
Ask whether this global variable is private
|
java.util.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) |
Say 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 |
setPrivate(boolean b) |
Say whether this global variable is a "parameter" (an external variable, in XQuery terminology)
|
void |
setRequiredType(SequenceType type) |
Set the required type of the variable
|
void |
setSystemId(java.lang.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 |
setVariableQName(StructuredQName qName) |
Set the variable name
|
void |
typeCheck(ExpressionVisitor visitor) |
Type check the compiled representation of this global variable
|
public void setRequiredType(SequenceType type)
type
- the declared type, from the "as" clause if presentpublic SequenceType getRequiredType()
public void setVariableQName(StructuredQName qName)
qName
- the variable namepublic StructuredQName getVariableQName()
getVariableQName
in interface VariableDeclaration
public void setLineNumber(int lineNumber)
lineNumber
- the line numberpublic int getLineNumber()
getLineNumber
in interface javax.xml.transform.SourceLocator
public int getColumnNumber()
getColumnNumber
in interface javax.xml.transform.SourceLocator
public java.lang.String getPublicId()
getPublicId
in interface javax.xml.transform.SourceLocator
public void setSystemId(java.lang.String systemId)
systemId
- the System ID (base URI)public java.lang.String getSystemId()
getSystemId
in interface javax.xml.transform.SourceLocator
public void setValueExpression(Expression val)
val
- the initializing expressionpublic Expression getValueExpression()
public void setIsParameter(boolean b)
b
- true if this variable is externalpublic boolean isParameter()
public boolean isPrivate()
public void setPrivate(boolean b)
b
- true if this variable is externalpublic void registerReference(BindingReference ref)
registerReference
in interface VariableDeclaration
ref
- the variable referencepublic java.util.Iterator iterateReferences()
VariableReference
public GlobalVariable compile(Executable exec, int slot) throws XPathException
exec
- the executableslot
- the slot number allocated to this variableXPathException
- if compile-time errors are found.public void typeCheck(ExpressionVisitor visitor) throws XPathException
visitor
- an expression visitorXPathException
- if compile-time errors are found.public GlobalVariable getCompiledVariable()
public void explain(ExpressionPresenter out)
out
- the destination to be used