net.sf.saxon.style

Class XSLGeneralVariable

public abstract class XSLGeneralVariable extends StyleElement

This class defines common behaviour across xsl:variable, xsl:param, and xsl:with-param
Field Summary
protected booleanassignable
protected StringconstantText
protected booleanglobal
protected booleanredundant
protected booleanrequiredParam
protected SequenceTyperequiredType
protected Expressionselect
protected SlotManagerslotManager
protected booleantunnel
Method Summary
protected booleanallowsAsAttribute()
protected booleanallowsRequired()
protected booleanallowsTunnelAttribute()
protected booleanallowsValue()
protected voidcheckAgainstRequiredType(SequenceType required)
Check the supplied select expression against the required type.
intgetConstructType()
Get the type of construct.
protected ItemTypegetReturnedItemType()
Determine the type of item returned by this instruction (only relevant if it is an instruction).
intgetVariableFingerprint()
Get the fingerprint of the variable name
StringgetVariableName()
Get the display name of the variable.
protected voidinitializeInstruction(Executable exec, GeneralVariable var)
Initialize - common code called from the compile() method of all subclasses
booleanisAssignable()
Test whether it is permitted to assign to the variable using the saxon:assign extension element.
booleanisGlobal()
booleanisRequiredParam()
booleanisTunnelParam()
booleanmayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a template-body
voidprepareAttributes()
voidsetRedundant()
Mark this global variable as redundant.
protected voidsetReferenceCount(GeneralVariable var)
voidvalidate()

Field Detail

assignable

protected boolean assignable

constantText

protected String constantText

global

protected boolean global

redundant

protected boolean redundant

requiredParam

protected boolean requiredParam

requiredType

protected SequenceType requiredType

select

protected Expression select

slotManager

protected SlotManager slotManager

tunnel

protected boolean tunnel

Method Detail

allowsAsAttribute

protected boolean allowsAsAttribute()

allowsRequired

protected boolean allowsRequired()

allowsTunnelAttribute

protected boolean allowsTunnelAttribute()

allowsValue

protected boolean allowsValue()

checkAgainstRequiredType

protected void checkAgainstRequiredType(SequenceType required)
Check the supplied select expression against the required type.

Parameters: required The type required by the variable declaration, or in the case of xsl:with-param, the signature of the called template

getConstructType

public int getConstructType()
Get the type of construct. This will be a constant in class Location. This method is part of the InstructionInfo interface

getReturnedItemType

protected ItemType getReturnedItemType()
Determine the type of item returned by this instruction (only relevant if it is an instruction).

Returns: the item type returned. This is null for a variable: we are not interested in the type of the variable, but in what the xsl:variable constributes to the result of the sequence constructor it is part of.

getVariableFingerprint

public int getVariableFingerprint()
Get the fingerprint of the variable name

getVariableName

public String getVariableName()
Get the display name of the variable.

initializeInstruction

protected void initializeInstruction(Executable exec, GeneralVariable var)
Initialize - common code called from the compile() method of all subclasses

isAssignable

public 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.

isGlobal

public boolean isGlobal()

isRequiredParam

public boolean isRequiredParam()

isTunnelParam

public boolean isTunnelParam()

mayContainSequenceConstructor

public boolean mayContainSequenceConstructor()
Determine whether this type of element is allowed to contain a template-body

Returns: true: yes, it may contain a template-body

prepareAttributes

public void prepareAttributes()

setRedundant

public void setRedundant()
Mark this global variable as redundant. This is done before prepareAttributes is called.

setReferenceCount

protected void setReferenceCount(GeneralVariable var)

validate

public void validate()