| 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.MutableNodeInfo; |
| 11 | import net.sf.saxon.om.NodeInfo; |
| 12 | import net.sf.saxon.trans.XPathException; |
| 13 | |
| 14 | import java.util.Set; |
| 15 | |
| 16 | /** |
| 17 | * A PendingUpdateList is created by updating expressions in XQuery Update. |
| 18 | * <p>The implementation of this interface is in Saxon-EE.</p> |
| 19 | */ |
| 20 | public interface PendingUpdateList { |
| 21 | |
| 22 | /** |
| 23 | * Apply the pending updates |
| 24 | * |
| 25 | * @param context the XPath dynamic evaluation context |
| 26 | * @param validationMode the revalidation mode from the static context |
| 27 | * @throws XPathException if the operation fails |
| 28 | */ |
| 29 | |
| 30 | void apply(XPathContext context, int validationMode) throws XPathException; |
| 31 | |
| 32 | /** |
| 33 | * Get the root nodes of the trees that are affected by updates in the pending update list |
| 34 | * |
| 35 | * @return the root nodes of affected trees, as a Set |
| 36 | */ |
| 37 | |
| 38 | Set<MutableNodeInfo> getAffectedTrees(); |
| 39 | |
| 40 | /** |
| 41 | * Add a put() action to the pending update list |
| 42 | * |
| 43 | * @param node (the first argument of put()) |
| 44 | * @param uri (the second argument of put()) |
| 45 | * @param originator the originating put() expression, for diagnostics |
| 46 | */ |
| 47 | |
| 48 | void addPutAction(NodeInfo node, String uri, Expression originator) throws XPathException; |
| 49 | } |
| 50 |