Class AbstractDestination

java.lang.Object
net.sf.saxon.s9api.AbstractDestination
All Implemented Interfaces:
Destination
Direct Known Subclasses:
DOMDestination, NullDestination, RawDestination, ReceivingDestination, SAXDestination, SchemaValidator, Serializer, TeeDestination, XdmDestination, XMLStreamWriterDestination, XQueryEvaluator

public abstract class AbstractDestination extends Object implements Destination
An abstract class providing reusable code for implementing the Destination interface
  • Field Details

  • Constructor Details

    • AbstractDestination

      public AbstractDestination()
  • Method Details

    • setDestinationBaseURI

      public void setDestinationBaseURI(URI baseURI)
      Set the base URI of the resource being written to this destination
      Specified by:
      setDestinationBaseURI in interface Destination
      Parameters:
      baseURI - the base URI to be used
    • getDestinationBaseURI

      public URI getDestinationBaseURI()
      Get the base URI of the resource being written to this destination
      Specified by:
      getDestinationBaseURI in interface Destination
      Returns:
      the baseURI, or null if none is known
    • onClose

      public final void onClose(Action listener)
      Register a listener to be notified when this destination is closed
      Specified by:
      onClose in interface Destination
      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 Destination.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.
      Specified by:
      closeAndNotify in interface Destination
      Throws:
      SaxonApiException - if the close() method throws SaxonApiException.