net.sf.saxon.instruct
Class GeneralVariable

java.lang.Object
  extended bynet.sf.saxon.instruct.Instruction
      extended bynet.sf.saxon.instruct.GeneralVariable
All Implemented Interfaces:
Serializable, SourceLocator
Direct Known Subclasses:
Assign, DefiningVariable, SQLColumn.ColumnInstruction, WithParam

public abstract class GeneralVariable
extends Instruction

This class defines common behaviour across xsl:variable, xsl:param, and xsl:with-param; also saxon:assign

See Also:
Serialized Form

Field Summary
protected  int variableFingerprint
           
 
Fields inherited from class net.sf.saxon.instruct.Instruction
children
 
Constructor Summary
GeneralVariable()
           
 
Method Summary
 boolean containsLocals()
           
 SequenceType getRequiredType()
           
 SequenceType getResultType()
          Get the result type of the instruction.
 Expression getSelectExpression()
           
 Value getSelectValue(XPathContext context)
          Evaluate the variable.
 int getVariableFingerprint()
           
 void init(Expression select, SequenceType requiredType, int variableFingerprint)
           
 boolean isAssignable()
          Test whether it is permitted to assign to the variable using the saxon:assign extension element.
 boolean isGlobal()
           
 boolean isRequiredParam()
           
 boolean isTunnelParam()
           
 void setAssignable(boolean assignable)
           
 void setContainsLocals(boolean containsLocals)
           
 void setGlobal(boolean global)
           
 void setInstructionDetails(Controller controller, NamePool namePool, InstructionDetails details)
          Get the name of the instruction for use in diagnostics
 void setRequiredParam(boolean requiredParam)
           
 void setRequiredType(SequenceType requiredType)
           
 void setSelect(Expression select)
           
 void setTunnel(boolean tunnel)
           
 void setVariableFingerprint(int variableFingerprint)
           
 
Methods inherited from class net.sf.saxon.instruct.Instruction
assembleParams, assembleTunnelParams, getChildren, getColumnNumber, getInstructionDetails, getInstructionName, getLineNumber, getPublicId, getSystemId, getSystemId, process, processChildren, processChildrenLeavingTail, processLeavingTail, recoverableError, setChildren, setSourceLocation, styleError, styleError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

variableFingerprint

protected int variableFingerprint
Constructor Detail

GeneralVariable

public GeneralVariable()
Method Detail

init

public void init(Expression select,
                 SequenceType requiredType,
                 int variableFingerprint)

setSelect

public void setSelect(Expression select)

getSelectExpression

public Expression getSelectExpression()

setRequiredType

public void setRequiredType(SequenceType requiredType)

setVariableFingerprint

public void setVariableFingerprint(int variableFingerprint)

setGlobal

public void setGlobal(boolean global)

setAssignable

public void setAssignable(boolean assignable)

setRequiredParam

public void setRequiredParam(boolean requiredParam)

setContainsLocals

public void setContainsLocals(boolean containsLocals)

setTunnel

public void setTunnel(boolean tunnel)

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 true if the extra attribute saxon:assignable="yes" is present.


getVariableFingerprint

public int getVariableFingerprint()

getRequiredType

public SequenceType getRequiredType()

getResultType

public SequenceType getResultType()
Get the result type of the instruction. This is not the type of the variable, but the type of the value added to the result sequence when the instruction is executed: This result is always an empty sequence.

Overrides:
getResultType in class Instruction
Returns:
A SequenceType denoting the type EMPTY

isGlobal

public final boolean isGlobal()

containsLocals

public final boolean containsLocals()

isRequiredParam

public final boolean isRequiredParam()

isTunnelParam

public final boolean isTunnelParam()

setInstructionDetails

public void setInstructionDetails(Controller controller,
                                  NamePool namePool,
                                  InstructionDetails details)
Description copied from class: Instruction
Get the name of the instruction for use in diagnostics

Specified by:
setInstructionDetails in class Instruction

getSelectValue

public Value getSelectValue(XPathContext context)
                     throws TransformerException
Evaluate the variable. That is, get the value of the select expression if present or the content of the element otherwise, either as a tree or as a sequence

Throws:
TransformerException