public abstract class Emitter extends SequenceReceiver implements ReceiverWithOutputProperties
The interface is deliberately designed to be as close as possible to the standard SAX2 ContentHandler interface, however, it allows additional information to be made available.
An Emitter is a Receiver, specifically it is a Receiver that can direct output to a Writer or OutputStream, using serialization properties defined in a Properties object.
The Emitter (from 11.0 onwards) writes to a UnicodeWriter, which may itself bridge to a Writer or OutputStream.
Modifier and Type | Field and Description |
---|---|
protected boolean |
allCharactersEncodable |
protected CharacterSet |
characterSet |
protected java.util.Properties |
outputProperties |
protected UnicodeWriter |
writer |
pipelineConfiguration, previousAtomic, systemId
Constructor and Description |
---|
Emitter() |
Modifier and Type | Method and Description |
---|---|
void |
append(Item item,
Location locationId,
int copyNamespaces)
Append an arbitrary item (node or atomic value) to the output
|
void |
close()
Notify the end of the event stream
|
java.util.Properties |
getOutputProperties()
Get the output properties
|
void |
setMustClose(boolean mustClose) |
void |
setOutputProperties(java.util.Properties details)
Set output properties
|
void |
setUnicodeWriter(UnicodeWriter unicodeWriter) |
void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri,
java.lang.String publicId)
Set unparsed entity URI.
|
boolean |
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations
supplied on element and attribute events
|
append, decompose, flatten, getConfiguration, getErrorCodeForDecomposingFunctionItems, getNamePool, getPipelineConfiguration, getSystemId, handlesAppend, open, setPipelineConfiguration, setSystemId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
append, characters, comment, endDocument, endElement, getPipelineConfiguration, handlesAppend, open, processingInstruction, setPipelineConfiguration, startDocument, startElement
protected UnicodeWriter writer
protected java.util.Properties outputProperties
protected CharacterSet characterSet
protected boolean allCharactersEncodable
public void setOutputProperties(java.util.Properties details) throws XPathException
details
- the output serialization propertiesXPathException
- if an error occurs finding the encoding propertypublic java.util.Properties getOutputProperties()
getOutputProperties
in interface ReceiverWithOutputProperties
public void setUnicodeWriter(UnicodeWriter unicodeWriter)
public void setMustClose(boolean mustClose)
public void setUnparsedEntity(java.lang.String name, java.lang.String uri, java.lang.String publicId) throws XPathException
setUnparsedEntity
in interface Receiver
setUnparsedEntity
in class SequenceReceiver
name
- the entity nameuri
- the entity system IDpublicId
- the entity public IDXPathException
- if an error occurspublic void close() throws XPathException
close
in interface Receiver
XPathException
- if an error occurspublic boolean usesTypeAnnotations()
usesTypeAnnotations
in interface Receiver
public void append(Item item, Location locationId, int copyNamespaces) throws XPathException
append
in interface Receiver
append
in class SequenceReceiver
item
- the item to be appendedlocationId
- the location of the calling instruction, for diagnosticscopyNamespaces
- if the item is an element node, this indicates whether its namespaces
need to be copied. Values are ReceiverOption.ALL_NAMESPACES
; the default (0) meansXPathException
- if an error occursCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.