Package net.sf.saxon.s9api

## Class DestinationHelper

- java.lang.Object
- - net.sf.saxon.s9api.DestinationHelper

-     public class DestinationHelper
      extends java.lang.Object

  A helper class for implementing the `Destination` interface

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DestinationHelper​(Destination helpee)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `closeAndNotify()` | Close the destination and notify all registered listeners that it has been closed.
    `java.util.List<Action>` | `getListeners()` |
    `void` | `onClose​(Action listener)` | Register a listener to be notified when this destination is closed

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DestinationHelper

          public DestinationHelper​(Destination helpee)

  - ### Method Detail

    - #### onClose

          public final void onClose​(Action listener)

      Register a listener to be notified when this destination is closed
      Parameters:
        `listener` - an object to be notified when writing to the destination is successfully completed

    - #### closeAndNotify

          public void closeAndNotify()
                              throws SaxonApiException

      Close the destination and notify all registered listeners that it has been closed. This method is intended for internal use by Saxon. The method first calls `close` to close the destination, then it calls `Consumer.accept(T)` on each of the listeners in turn to notify the fact that it has been closed.
      Throws:
        `SaxonApiException` - if the close() method throws `SaxonApiException`.

    - #### getListeners

          public java.util.List<Action> getListeners()