Class SourceBinding

  • public class SourceBinding
    extends java.lang.Object
    Helper class for xsl:variable and xsl:param elements.
    • Constructor Detail

      • SourceBinding

        public SourceBinding​(StyleElement sourceElement)
    • Method Detail

      • prepareTemplateSignatureAttributes

        public 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. It is called while a named template is being indexed: see bug 3722.
      • getSourceElement

        public StyleElement getSourceElement()
        Get the declaration in the stylesheet
        the node in the stylesheet containing this variable binding
      • setVariableQName

        public void setVariableQName​(StructuredQName name)
        Set the name of the variable
        name - the name of the variable as a QName
      • setDeclaredType

        public void setDeclaredType​(SequenceType declaredType)
        Set the declared type of the variable
        declaredType - the declared type
      • postValidate

        public void postValidate()
                          throws XPathException
        Hook to allow additional validation of a parent element immediately after its children have been validated.
        XPathException - if the declaration is invalid
      • isStatic

        public boolean isStatic()
      • checkAgainstRequiredType

        public void checkAgainstRequiredType​(SequenceType required)
        Check the supplied select expression against the required type.
        required - The type required by the variable declaration, or in the case of xsl:with-param, the signature of the called template
      • getVariableQName

        public StructuredQName getVariableQName()
        Get the name of the variable
        the variable's name
      • hasProperty

        public boolean hasProperty​(SourceBinding.BindingProperty prop)
        Get a boolean property of the variable
        prop - the property whose value is required
        true if the variable has the specified property, otherwise false
      • getReferences

        public java.util.List<BindingReference> getReferences()
        Get all the known references to this variable
        the list of references
      • getSlotManager

        public SlotManager getSlotManager()
        Get the SlotManager associated with this stylesheet construct. The SlotManager contains the information needed to manage the local stack frames used by run-time instances of the code.
        the associated SlotManager object
      • handleSequenceConstructor

        public void handleSequenceConstructor​(Compilation compilation,
                                              ComponentDeclaration decl)
                                       throws XPathException
        If the element contains a sequence constructor, convert this to an expression and assign it to the select attribute
        compilation - the compilation episode
        decl - the declaration being compiled
        XPathException - if a static error is found, for example a type error
      • getDeclaredType

        public SequenceType getDeclaredType()
        Get the type actually declared for the attribute
        the type appearing in the "as" attribute, or null if the attribute was absent
      • getSelectExpression

        public Expression getSelectExpression()
        Get the select expression actually appearing in the variable declaration
        the select expression as it appears, or null if it is absent
      • getInferredType

        public SequenceType getInferredType​(boolean useContentRules)
        Get the best available static type of the variable.
        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 attribute
        the static type declared for the variable, or inferred from its initialization
      • registerReference

        public void registerReference​(BindingReference ref)
        Method called by VariableReference to register the variable reference for subsequent fixup
        ref - the variable reference being registered
      • fixupReferences

        public void fixupReferences​(GlobalVariable compiledGlobalVariable)
        Notify all references to this variable of the data type
        compiledGlobalVariable - null if this is a local variable; otherwise, the compiled global variable
      • fixupBinding

        protected void fixupBinding​(Binding binding)
        Notify all variable references of the Binding instruction
        binding - the Binding that represents this variable declaration in the executable code tree