net.sf.saxon.instruct
Class GeneralVariable

java.lang.Object
  |
  +--net.sf.saxon.instruct.Instruction
        |
        +--net.sf.saxon.instruct.GeneralVariable
All Implemented Interfaces:
Instr, Locatable, java.io.Serializable, javax.xml.transform.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()
           
 int getCardinality()
          Get the cardinality of the sequence returned by evaluating this instruction
 java.lang.String getInstructionName()
          Get the name of the instruction for use in diagnostics
 ItemType getItemType()
          Get the item type of the items returned by evaluating this 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 setRequiredParam(boolean requiredParam)
           
 void setSelect(Expression select)
           
 void setTunnel(boolean tunnel)
           
 void setVariableFingerprint(int variableFingerprint)
           
 
Methods inherited from class net.sf.saxon.instruct.Instruction
assembleParams, assembleTunnelParams, displayChildren, dynamicError, dynamicError, getChildren, getColumnNumber, getExecutable, getInstructionNamespace, getLineNumber, getPublicId, getSourceLocator, getSystemId, process, processChildren, processChildrenLeavingTail, processLeavingTail, recoverableError, setChildren, setExecutable, setSourceLocation
 
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()

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()

getItemType

public ItemType getItemType()
Description copied from class: Instruction
Get the item type of the items returned by evaluating this instruction

Overrides:
getItemType in class Instruction
Returns:
the static item type of the instruction

getCardinality

public int getCardinality()
Description copied from class: Instruction
Get the cardinality of the sequence returned by evaluating this instruction

Overrides:
getCardinality in class Instruction
Returns:
the static cardinality

isGlobal

public final boolean isGlobal()

containsLocals

public final boolean containsLocals()

isRequiredParam

public final boolean isRequiredParam()

isTunnelParam

public final boolean isTunnelParam()

getInstructionName

public java.lang.String getInstructionName()
Description copied from class: Instruction
Get the name of the instruction for use in diagnostics

Specified by:
getInstructionName in class Instruction

getSelectValue

public Value getSelectValue(XPathContext context)
                     throws javax.xml.transform.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

javax.xml.transform.TransformerException