| 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.trans.SymbolicName; |
| 11 | |
| 12 | /** |
| 13 | * Represents an expression or instruction such as call-template, or a user function call, or |
| 14 | * a global variable reference, that needs to be bound to a target component, and can potentially |
| 15 | * be re-bound when the containing component is copied into another package. |
| 16 | */ |
| 17 | public interface ComponentInvocation { |
| 18 | |
| 19 | /** |
| 20 | * Get the target component if this is known in advance, that is, if the target component |
| 21 | * is private or final, or in some other cases such as xsl:original. Otherwise, return null. |
| 22 | * @return the bound component if the binding has been fixed |
| 23 | */ |
| 24 | |
| 25 | Component getFixedTarget(); |
| 26 | |
| 27 | /** |
| 28 | * Set the binding slot to be used. This is the offset within the binding vector of the containing |
| 29 | * component where the actual target component is to be found. The target template is not held directly |
| 30 | * in the invocation instruction/expression itself because it can be overridden in a using package. |
| 31 | * |
| 32 | * @param slot the offset in the binding vector of the containing package where the target component |
| 33 | * can be found. |
| 34 | */ |
| 35 | |
| 36 | void setBindingSlot(int slot); |
| 37 | |
| 38 | /** |
| 39 | * Get the binding slot to be used. This is the offset within the binding vector of the containing |
| 40 | * component where the actual target component is to be found. |
| 41 | * |
| 42 | * @return the offset in the binding vector of the containing package where the target component |
| 43 | * can be found. |
| 44 | */ |
| 45 | |
| 46 | int getBindingSlot(); |
| 47 | |
| 48 | /** |
| 49 | * Get the symbolic name of the component that this invocation references |
| 50 | * @return the symbolic name of the target component, or null if there is no component referenced |
| 51 | */ |
| 52 | |
| 53 | SymbolicName getSymbolicName(); |
| 54 | |
| 55 | |
| 56 | } |
| 57 |