Package net.sf.saxon.jaxp
Class ReceivingDestination
- java.lang.Object
-
- net.sf.saxon.s9api.AbstractDestination
-
- net.sf.saxon.jaxp.ReceivingDestination
-
- All Implemented Interfaces:
Destination
public class ReceivingDestination extends AbstractDestination
An implementation ofDestination
that simply wraps a suppliedReceiver
The supplied
Receiver
will be wrapped in a sequence normalizer unless requested otherwise. Specifically, it is wrapped unless the methodacceptsRawOutput()
returns true.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.s9api.AbstractDestination
helper
-
-
Constructor Summary
Constructors Constructor Description ReceivingDestination(Receiver target)
Create aReceivingDestination
that wraps a suppliedReceiver
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptsRawOutput()
Ask whether this receiver accepts raw output, that is, an arbitrary sequence of items not necessarily forming an XML document or element tree.void
close()
Close the destination, allowing resources to be released.Receiver
getReceiver(PipelineConfiguration pipe, SerializationProperties properties)
Get aReceiver
to which events may be sent.-
Methods inherited from class net.sf.saxon.s9api.AbstractDestination
closeAndNotify, getDestinationBaseURI, onClose, setDestinationBaseURI
-
-
-
-
Constructor Detail
-
ReceivingDestination
public ReceivingDestination(Receiver target)
Create aReceivingDestination
that wraps a suppliedReceiver
- Parameters:
target
- the suppliedReceiver
. This must accept a regular event sequence as defined inRegularSequenceChecker
-
-
Method Detail
-
getReceiver
public Receiver getReceiver(PipelineConfiguration pipe, SerializationProperties properties)
Get aReceiver
to which events may be sent. For this implementation, this will be the wrappedReceiver
.- Parameters:
pipe
- The Saxon configuration. Not used in this implementation.properties
- The required serialization properties (not used)- Returns:
- the wrapped
Receiver
-
acceptsRawOutput
public boolean acceptsRawOutput()
Ask whether this receiver accepts raw output, that is, an arbitrary sequence of items not necessarily forming an XML document or element tree. May be overridden in a subclass.- Returns:
- false unless one of the following conditions is true:
- The
Receiver
is an instance ofSequenceNormalizer
- The
Receiver
implementsReceiverWithOutputProperties
, and a call ongetOutputProperties(SaxonOutputPropertes.REQUIRE_WELL_FORMED)
returns "no" - The method
#acceptsRawOutput()
is implemented in a subclass ofReceivingDestination
, and returns false.
- The
-
close
public void close() throws SaxonApiException
Description copied from interface:Destination
Close the destination, allowing resources to be released. Saxon calls this method when it has finished writing to the destination.The
close()
method should not cause any adverse effects if it is called more than once. If any other method is called after theclose()
call, the results are undefined. This means that a Destination is not, in general, serially reusable.If an
Destination.onClose(net.sf.saxon.s9api.Action)
action has been associated with the destination, this will be called after the destination is closed.- Throws:
SaxonApiException
- if any failure occurs
-
-