net.sf.saxon.event

Class Emitter

public abstract class Emitter extends Object implements Result, Receiver

Emitter: This abstract class defines methods that must be implemented by components that format SAXON output. There is one emitter for XML, one for HTML, and so on. Additional methods are concerned with setting options and providing a Writer.

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 CharacterSetcharacterSet
protected NamePoolnamePool
protected PropertiesoutputProperties
protected OutputStreamoutputStream
protected PipelineConfigurationpipelineConfig
protected StreamResultstreamResult
protected StringsystemId
protected Writerwriter
Method Summary
ConfigurationgetConfiguration()
Get the configuration used for this document
PropertiesgetOutputProperties()
Get the output properties
OutputStreamgetOutputStream()
Get the output stream
PipelineConfigurationgetPipelineConfiguration()
Get the pipeline configuration used for this document
StringgetSystemId()
Get the System ID
WritergetWriter()
Get the output writer
static ReceivermakeEmitter(String className, Controller controller)
Load a named output emitter or SAX2 ContentHandler and check it is OK.
protected voidmakeWriter()
Make a Writer for this Emitter to use, given a StreamResult
voidsetOutputProperties(Properties details)
Set output properties
voidsetOutputStream(OutputStream stream)
Set the output destination as a byte stream
voidsetPipelineConfiguration(PipelineConfiguration pipe)
Set the namePool in which all name codes can be found
voidsetStreamResult(StreamResult result)
Set the StreamResult acting as the output destination of the Emitter
voidsetSystemId(String systemId)
Set the System ID
voidsetUnparsedEntity(String name, String uri, String publicId)
Set unparsed entity URI.
voidsetWriter(Writer writer)
Set the output destination as a character stream
booleanusesWriter()
Determine whether the Emitter wants a Writer for character output or an OutputStream for binary output.

Field Detail

characterSet

protected CharacterSet characterSet

namePool

protected NamePool namePool

outputProperties

protected Properties outputProperties

outputStream

protected OutputStream outputStream

pipelineConfig

protected PipelineConfiguration pipelineConfig

streamResult

protected StreamResult streamResult

systemId

protected String systemId

writer

protected Writer writer

Method Detail

getConfiguration

public Configuration getConfiguration()
Get the configuration used for this document

getOutputProperties

public Properties getOutputProperties()
Get the output properties

getOutputStream

public OutputStream getOutputStream()
Get the output stream

getPipelineConfiguration

public PipelineConfiguration getPipelineConfiguration()
Get the pipeline configuration used for this document

getSystemId

public String getSystemId()
Get the System ID

getWriter

public Writer getWriter()
Get the output writer

makeEmitter

public static Receiver makeEmitter(String className, Controller controller)
Load a named output emitter or SAX2 ContentHandler and check it is OK.

makeWriter

protected void makeWriter()
Make a Writer for this Emitter to use, given a StreamResult

setOutputProperties

public void setOutputProperties(Properties details)
Set output properties

setOutputStream

public void setOutputStream(OutputStream stream)
Set the output destination as a byte stream

setPipelineConfiguration

public void setPipelineConfiguration(PipelineConfiguration pipe)
Set the namePool in which all name codes can be found

setStreamResult

public void setStreamResult(StreamResult result)
Set the StreamResult acting as the output destination of the Emitter

setSystemId

public void setSystemId(String systemId)
Set the System ID

setUnparsedEntity

public void setUnparsedEntity(String name, String uri, String publicId)
Set unparsed entity URI. Needed to satisfy the Receiver interface, but not used, because unparsed entities can occur only in input documents, not in output documents.

setWriter

public void setWriter(Writer writer)
Set the output destination as a character stream

usesWriter

public boolean usesWriter()
Determine whether the Emitter wants a Writer for character output or an OutputStream for binary output. The standard Emitters all use a Writer, so this returns true; but a subclass can override this if it wants to use an OutputStream