net.sf.saxon.event
public abstract class Emitter extends Object implements Result, Receiver
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.
Field Summary | |
---|---|
protected boolean | allCharactersEncodable |
protected CharacterSet | characterSet |
protected NamePool | namePool |
protected Properties | outputProperties |
protected OutputStream | outputStream |
protected PipelineConfiguration | pipelineConfig |
protected StreamResult | streamResult |
protected String | systemId |
protected Writer | writer |
Method Summary | |
---|---|
Configuration | getConfiguration()
Get the configuration used for this document |
Properties | getOutputProperties()
Get the output properties |
OutputStream | getOutputStream()
Get the output stream |
PipelineConfiguration | getPipelineConfiguration()
Get the pipeline configuration used for this document |
String | getSystemId()
Get the System ID |
Writer | getWriter()
Get the output writer |
protected void | makeWriter()
Make a Writer for this Emitter to use, given a StreamResult. |
void | setOutputProperties(Properties details)
Set output properties |
void | setOutputStream(OutputStream stream)
Set the output destination as a byte stream.
|
void | setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipelineConfiguration |
void | setStreamResult(StreamResult result)
Set the StreamResult acting as the output destination of the Emitter |
void | setSystemId(String systemId)
Set the System ID |
void | setUnparsedEntity(String name, String uri, String publicId)
Set unparsed entity URI. |
void | setWriter(Writer writer)
Set the output destination as a character stream |
boolean | usesWriter()
Determine whether the Emitter wants a Writer for character output or
an OutputStream for binary output. |
Returns: the configuration
Returns: the output serialization properties. The returned value will be null if setOutputProperties() has not been called
Returns: the OutputStream being used as an output destination, if any
Returns: the Writer being used as an output destination, if any
Parameters: details the output serialization properties
Note that if a specific encoding (other than the default, UTF-8) is required, then setOutputProperties must be called before calling this method.
Parameters: stream the OutputStream being used as an output destination
Parameters: result the output destination
Parameters: systemId the system identifier (=base URI)
Parameters: name the entity name uri the entity system ID publicId the entity public ID
Parameters: writer the Writer to use as an output destination
Returns: true if a Writer is needed, as distinct from an OutputStream