Debian Codegraph @

net/sf/saxon/event/CloseNotifier.java

raw symbols SCIP
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.event;
9
10 import net.sf.saxon.s9api.Action;
11 import net.sf.saxon.s9api.SaxonApiException;
12 import net.sf.saxon.trans.XPathException;
13
14 import java.util.List;
15
16 /**
17 *
18 */
19
20 public class CloseNotifier extends ProxyReceiver {
21
22 private List<Action> actionList;
23
24 public CloseNotifier(Receiver next, List<Action> actionList) {
25 super(next);
26 this.actionList = actionList;
27 }
28
29
30 /**
31 * End of output. Note that closing this receiver also closes the rest of the
32 * pipeline.
33 */
34 @Override
35 public void close() throws XPathException {
36 super.close();
37 try {
38 if (actionList != null) {
39 for (Action action : actionList) {
40 action.act();
41 }
42 }
43 } catch (SaxonApiException e) {
44 throw XPathException.makeXPathException(e);
45 }
46 }
47
48 }
49