| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 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 |
|
| 32 |
|
| 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 |
|