| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | package net.sf.saxon.expr; |
| 9 | |
| 10 | import net.sf.saxon.om.GroundedValue; |
| 11 | import net.sf.saxon.om.Item; |
| 12 | import net.sf.saxon.value.SequenceType; |
| 13 | |
| 14 | /** |
| 15 | * BindingReference is a interface used to mark references to a variable declaration. The main |
| 16 | * implementation is VariableReference, which represents a reference to a variable in an XPath |
| 17 | * expression, but it is also used to represent a reference to a variable in a saxon:assign instruction. |
| 18 | */ |
| 19 | |
| 20 | public interface BindingReference { |
| 21 | |
| 22 | /** |
| 23 | * Fix up the static type of this variable reference; optionally, supply a constant value for |
| 24 | * the variable. Also supplies other static properties of the expression to which the variable |
| 25 | * is bound, for example whether it is an ordered node-set. |
| 26 | * @param type The static type of the variable reference, typically either the declared type |
| 27 | * of the variable, or the static type of the expression to which the variable is bound |
| 28 | * @param constantValue if non-null, indicates that the value of the variable is known at compile |
| 29 | * time, and supplies the value |
| 30 | * @param properties static properties of the expression to which the variable is bound |
| 31 | */ |
| 32 | |
| 33 | void setStaticType(SequenceType type, GroundedValue<?> constantValue, int properties); |
| 34 | |
| 35 | /** |
| 36 | * Fix up this binding reference to a binding |
| 37 | * |
| 38 | * @param binding the Binding to which the variable refers |
| 39 | */ |
| 40 | |
| 41 | void fixup(Binding binding); |
| 42 | |
| 43 | } |
| 44 |