Package net.sf.saxon.s9api
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 java.lang.Object implements Destination
An abstract class providing reusable code for implementing theDestinationinterface}
-
-
Field Summary
Fields Modifier and Type Field Description protected DestinationHelperhelper
-
Constructor Summary
Constructors Constructor Description AbstractDestination()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAndNotify()Close the destination and notify all registered listeners that it has been closed.java.net.URIgetDestinationBaseURI()Get the base URI of the resource being written to this destinationvoidonClose(Action listener)Register a listener to be notified when this destination is closedvoidsetDestinationBaseURI(java.net.URI baseURI)Set the base URI of the resource being written to this destination-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.s9api.Destination
close, getReceiver
-
-
-
-
Field Detail
-
helper
protected DestinationHelper helper
-
-
Method Detail
-
setDestinationBaseURI
public void setDestinationBaseURI(java.net.URI baseURI)
Set the base URI of the resource being written to this destination- Specified by:
setDestinationBaseURIin interfaceDestination- Parameters:
baseURI- the base URI to be used
-
getDestinationBaseURI
public java.net.URI getDestinationBaseURI()
Get the base URI of the resource being written to this destination- Specified by:
getDestinationBaseURIin interfaceDestination- 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:
onClosein interfaceDestination- Parameters:
listener- an object to be notified when writing to the destination is successfully completed
-
closeAndNotify
public void closeAndNotify() throws SaxonApiExceptionClose the destination and notify all registered listeners that it has been closed. This method is intended for internal use by Saxon. The method first callsDestination.close()to close the destination, then it callsConsumer.accept(T)on each of the listeners in turn to notify the fact that it has been closed.- Specified by:
closeAndNotifyin interfaceDestination- Throws:
SaxonApiException- if the close() method throwsSaxonApiException.
-
-