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 theDestination
interface}
-
-
Field Summary
Fields Modifier and Type Field Description protected DestinationHelper
helper
-
Constructor Summary
Constructors Constructor Description AbstractDestination()
-
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.net.URI
getDestinationBaseURI()
Get the base URI of the resource being written to this destinationvoid
onClose(Action listener)
Register a listener to be notified when this destination is closedvoid
setDestinationBaseURI(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:
setDestinationBaseURI
in 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:
getDestinationBaseURI
in 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:
onClose
in interfaceDestination
- 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 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:
closeAndNotify
in interfaceDestination
- Throws:
SaxonApiException
- if the close() method throwsSaxonApiException
.
-
-