public class SourceBinding
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
SourceBinding.BindingProperty |
Modifier and Type | Field and Description |
---|---|
protected SlotManager |
slotManager |
Constructor and Description |
---|
SourceBinding(StyleElement sourceElement) |
Modifier and Type | Method and Description |
---|---|
void |
checkAgainstRequiredType(SequenceType required)
Check the supplied select expression against the required type.
|
protected void |
fixupBinding(Binding binding)
Notify all variable references of the Binding instruction
|
void |
fixupReferences(GlobalVariable compiledGlobalVariable)
Notify all references to this variable of the data type
|
GroundedValue |
getConstantValue() |
SequenceType |
getDeclaredType()
Get the type actually declared for the attribute
|
SequenceType |
getInferredType(boolean useContentRules)
Get the best available static type of the variable.
|
java.util.List<BindingReference> |
getReferences()
Get all the known references to this variable
|
Expression |
getSelectExpression()
Get the select expression actually appearing in the variable declaration
|
SlotManager |
getSlotManager()
Get the SlotManager associated with this stylesheet construct.
|
StyleElement |
getSourceElement()
Get the declaration in the stylesheet
|
StructuredQName |
getVariableQName()
Get the name of the variable
|
void |
handleSequenceConstructor(Compilation compilation,
ComponentDeclaration decl)
If the element contains a sequence constructor, convert this to an expression and assign it to the
select attribute
|
boolean |
hasProperty(SourceBinding.BindingProperty prop)
Get a boolean property of the variable
|
boolean |
isStatic() |
void |
postValidate()
Hook to allow additional validation of a parent element immediately after its
children have been validated.
|
void |
prepareAttributes(java.util.EnumSet<SourceBinding.BindingProperty> permittedAttributes) |
void |
prepareTemplateSignatureAttributes()
This method is called to establish basic signature information for local parameters of a named template,
so that this can be checked against xsl:call-template instructions.
|
void |
registerReference(BindingReference ref)
Method called by VariableReference to register the variable reference for
subsequent fixup
|
void |
setDeclaredType(SequenceType declaredType)
Set the declared type of the variable
|
void |
setProperty(SourceBinding.BindingProperty prop,
boolean flag)
Set a boolean property of the variable
|
void |
setVariableQName(StructuredQName name)
Set the name of the variable
|
void |
validate()
Validate the declaration
|
protected SlotManager slotManager
public SourceBinding(StyleElement sourceElement)
public void prepareAttributes(java.util.EnumSet<SourceBinding.BindingProperty> permittedAttributes)
public void prepareTemplateSignatureAttributes()
public StyleElement getSourceElement()
public void setVariableQName(StructuredQName name)
name
- the name of the variable as a QNamepublic void setDeclaredType(SequenceType declaredType)
declaredType
- the declared typepublic void validate() throws XPathException
XPathException
- if the declaration is invalidpublic void postValidate() throws XPathException
XPathException
- if the declaration is invalidpublic boolean isStatic()
public void checkAgainstRequiredType(SequenceType required)
required
- The type required by the variable declaration, or in the case
of xsl:with-param, the signature of the called templatepublic StructuredQName getVariableQName()
public void setProperty(SourceBinding.BindingProperty prop, boolean flag)
prop
- the property to be set (e.g. SourceBinding.BindingProperty.TUNNEL
)flag
- true to set the property on, false to set it offpublic boolean hasProperty(SourceBinding.BindingProperty prop)
prop
- the property whose value is requiredpublic java.util.List<BindingReference> getReferences()
public SlotManager getSlotManager()
public void handleSequenceConstructor(Compilation compilation, ComponentDeclaration decl) throws XPathException
compilation
- the compilation episodedecl
- the declaration being compiledXPathException
- if a static error is found, for example a type errorpublic SequenceType getDeclaredType()
public Expression getSelectExpression()
public SequenceType getInferredType(boolean useContentRules)
useContentRules
- set to true if the standard rules for xsl:variable and similar elements apply,
whereby the element's contained sequence constructor substitutes for the select attributepublic void registerReference(BindingReference ref)
ref
- the variable reference being registeredpublic GroundedValue getConstantValue()
public void fixupReferences(GlobalVariable compiledGlobalVariable)
compiledGlobalVariable
- null if this is a local variable; otherwise, the compiled global variableprotected void fixupBinding(Binding binding)
binding
- the Binding that represents this variable declaration in the executable code treeCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.