public class SourceBinding
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
AS |
static int |
ASSIGNABLE |
static int |
DISALLOWS_CONTENT |
static int |
GLOBAL |
static int |
IMPLICITLY_DECLARED |
static int |
IMPLICITLY_REQUIRED |
static int |
PARAM |
static int |
PRIVATE |
static int |
REQUIRED |
static int |
SELECT |
protected SlotManager |
slotManager |
static int |
STATIC |
static int |
TUNNEL |
static int |
VISIBILITY |
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(int 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(int 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(int 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 static final int PRIVATE
public static final int GLOBAL
public static final int PARAM
public static final int TUNNEL
public static final int REQUIRED
public static final int IMPLICITLY_REQUIRED
public static final int ASSIGNABLE
public static final int SELECT
public static final int AS
public static final int DISALLOWS_CONTENT
public static final int STATIC
public static final int VISIBILITY
public static final int IMPLICITLY_DECLARED
public SourceBinding(StyleElement sourceElement)
public void prepareAttributes(int permittedAttributes) throws XPathException
XPathException
public void prepareTemplateSignatureAttributes() throws XPathException
XPathException
- if things go wrongpublic 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(int prop, boolean flag)
prop
- the property to be set (e.g. TUNNEL
)flag
- true to set the property on, false to set it offpublic boolean hasProperty(int 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-2020 Saxonica Limited. All rights reserved.